Skip to content

devlanes is in beta and not ready for production use.Report an issue

Start a service only on demand

A service nobody needs on every start, such as a component library’s docs or a webhook tunnel, can stay stopped until you ask for it.

::example{slug="workflows-profiles-tags"}

devlanes.yaml
services:
docs:
run_script:
file: apps/docs/package.json
name: dev
hosts: "docs.${{ lane.domain }}"
tags: [docs]
autostart: false

A plain start of the lane now leaves the service out and starts the rest. Its hostname stays routed, and a request to it gets the proxy’s DL201 Service not running page.

Name the service, or one of its tags with a plus, as in +docs:

~/dev/myapp
$ devlanes start docs --no-ui

It starts next to what the lane already runs. Until you stop it, a plain start brings it back with the rest.

A profile, a named selection of services, includes an on-demand service when it names it or its tag, and a glob such as * skips it. With a profile named default, a plain start runs exactly that profile, so use one of the two to leave a service out, not both. Share settings and choose which services start covers profiles.

Autostart also takes an expression, evaluated for each lane. This one starts the service in lane 0 and leaves it on demand everywhere else:

devlanes.yaml
services:
docs:
autostart: ${{ lane.index == 0 }}