Services
A deployment can contain multiple services. In the Build Output API, each service is emitted as its own sub-tree under .vercel/output/services, and the top-level config.json lists them. To configure services in your project, see Services.
.vercel/output/config.json
List the deployment's service build targets in the top-level config.json through a services array. Each entry names a service and its root:
{
"version": 3,
"services": [
{ "name": "web", "root": "web/" },
{ "name": "api", "root": "api/", "entrypoint": "main:app" }
]
}Vercel builds each service and emits its output under .vercel/output/services/<name>, rather than at the top level of .vercel/output.
.vercel/output/services
Each service is emitted at .vercel/output/services/<name>, where <name> is the service name. A service sub-tree is a complete, standard Build Output API tree with its own config.json, functions directory, and static assets. The same primitives and configuration that apply to a single-tree deployment apply inside each service sub-tree.
The web and api services above produce the following output:
Services do not nest. A service's own config.json describes only that service and does not contain a services field.
A service is internal by default. Public traffic reaches it only when the top-level route table delegates to it, and one service reaches another through a binding declared in its services configuration. To understand how requests are routed into a service and how bindings work, see Services routing and Service bindings.
- Middleware is not supported inside a service.
- The Edge runtime is not supported inside a service. A service that emits a Function with Edge Runtime is rejected at deploy.
- A deployment can contain up to 100 services.
- Service names may contain only lowercase letters, hyphens, and underscores, must start and end with a letter, and are limited to 64 characters.
Was this helpful?