Point a frontend at another lane's backend
Use this when a branch changes only the frontend and you want it to call the API of the main lane instead of starting a second backend.
::example{slug="workflows-profiles-tags"}
Add a profile that reads lane 0
Section titled “Add a profile that reads lane 0”A profile is a named set of services and settings a start can pick. This one starts only the web service and gives it lane 0’s API through lanes.main.
profiles: attach: include: [web] infra: false env: VITE_API_URL: "${{ lanes.main.services.api.public_url }}"profilesNamed selections of services for devlanes start --profile <name>. A plain devlanes start brings back what the lane ran before; default is used when there is nothing to bring back, such as after devlanes stop. A profile is a list of names, globs and +tag selectors, or a mapping that can also exclude services, skip infra, add env and remap script names.
profiles.<name>Services started by devlanes start --profile <name> (default when no profile is given): a list of names, globs and +tag selectors, or a mapping that can also exclude services, skip infra, add env and remap script names. Several --profile flags start the union.
profiles.<name>.includeServices this profile starts: names, globs such as crm-*, and +tag selectors. Globs skip services with autostart: false; names and tags include them.
profiles.<name>.infraSet false to skip containers and infra.setup, for example to run only a frontend against another lane's backend. A value that reads infra.* then resolves only while its container already runs, as a shared one another lane started does. Otherwise a service or task whose env reads it fails to start, and so does every service and task of the lane when global_env or a profile's env reads it. With several profiles active, infra is skipped only when all of them set false. Defaults to true.
profiles.<name>.envVariables for the services, tasks and infra.setup and infra.teardown commands of a lane while this profile is active, and for devlanes exec and devlanes with when they read neither self nor replica. They sit above each unit's own env, which cannot override them, so put a variable that some task must not get, such as NODE_ENV: production next to an install task that needs devDependencies, in global_env instead.
profiles.<name>.env.<name>Variables for the services, tasks and infra.setup and infra.teardown commands of a lane while this profile is active, and for devlanes exec and devlanes with when they read neither self nor replica. They sit above each unit's own env, which cannot override them, so put a variable that some task must not get, such as NODE_ENV: production next to an install task that needs devDependencies, in global_env instead.
The profile’s variable replaces the web service’s own. The infra: false line skips the lane’s containers and setup; its start tasks, such as a migration, still run.
Start the API in lane 0
Section titled “Start the API in lane 0”$ devlanes start 0:api --no-uiStart the frontend alone
Section titled “Start the frontend alone”Stop the feature lane first if it runs, since a start does not change services that already run. Then start the profile.
$ devlanes stop$ devlanes start --profile attach --no-uiThe web service of lane 1 starts and calls the API of lane 0.
If the API checks the origin
Section titled “If the API checks the origin”Each lane domain is a site of its own, so an API that allows only its own lane’s origins refuses the page of lane 1. Set CORS and cookies for each lane covers allowing it.
If the backend is another project
Section titled “If the backend is another project”Read it from the projects namespace, with a fallback for when that project runs nothing.
profiles: attach: include: [web] env: VITE_API_URL: "${{ projects.billing.services.api.public_url | default('https://billing.example.invalid') }}"profilesNamed selections of services for devlanes start --profile <name>. A plain devlanes start brings back what the lane ran before; default is used when there is nothing to bring back, such as after devlanes stop. A profile is a list of names, globs and +tag selectors, or a mapping that can also exclude services, skip infra, add env and remap script names.
profiles.<name>Services started by devlanes start --profile <name> (default when no profile is given): a list of names, globs and +tag selectors, or a mapping that can also exclude services, skip infra, add env and remap script names. Several --profile flags start the union.
profiles.<name>.includeServices this profile starts: names, globs such as crm-*, and +tag selectors. Globs skip services with autostart: false; names and tags include them.
profiles.<name>.envVariables for the services, tasks and infra.setup and infra.teardown commands of a lane while this profile is active, and for devlanes exec and devlanes with when they read neither self nor replica. They sit above each unit's own env, which cannot override them, so put a variable that some task must not get, such as NODE_ENV: production next to an install task that needs devDependencies, in global_env instead.
profiles.<name>.env.<name>Variables for the services, tasks and infra.setup and infra.teardown commands of a lane while this profile is active, and for devlanes exec and devlanes with when they read neither self nor replica. They sit above each unit's own env, which cannot override them, so put a variable that some task must not get, such as NODE_ENV: production next to an install task that needs devDependencies, in global_env instead.