Repository navigation
Description
Configure this repository to deploy on Vercel as a project with multiple services.
Here is a suggested vercel.json to add to the repo root directory, auto-detected from the repository layout. Treat it as a starting point, not a finished answer:
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"services": {
"app": {
"root": ".",
"framework": "jekyll"
},
"cloud-agent": {
"root": "apps/cloud-agent",
"framework": "nextjs"
},
"core": {
"root": "framework/packages/core",
"runtime": "node"
}
},
"rewrites": [
{
"source": "/(.*)",
"destination": {
"service": "app"
}
}
]
}How Vercel services work
Services let one repository deploy multiple backends and frontends as a single Vercel project, with shared routing, environment variables, and one domain. Each service is built independently, and at request time Vercel routes to a service based on the top-level rewrites.
- Define each service under the top-level
serviceskey. A service'srootis its directory relative to the directory containingvercel.json;framework,runtime,entrypoint, andbuildCommandare set per service. - A service is internal by default and receives no public traffic. It is only reachable from the internet if a top-level rewrite targets it, using the object form:
{ "source": "/api/(.*)", "destination": { "service": "my_backend" } }. - Order rewrites from the most specific path to the least; a catch-all
/(.*)should come last. - In services mode, build and runtime keys (
functions,installCommand,buildCommand,devCommand,ignoreCommand,outputDirectory,framework) are not valid at the top level and must move into the service they belong to. Public routing keys stay at the top level. vercel devruns all services together locally and injects binding variables. Use this command for testing.
Docs: https://vercel.com/docs/services
What I need you to do
-
Add bindings for internal services. Any service that calls another service should use a binding, declared on the calling service. A binding injects the target's internal URL into the calling service — it does not make the target public. Each entry looks like:
"bindings": [ { "type": "service", "service": "inventory", "format": "url", "env": "INVENTORY_URL" } ]
All four fields are required:
typeis always"service",serviceis the target's name inservices,formatis always"url", andenvis the variable Vercel injects the target's base URL into. Do not set that variable yourself. -
Update the application code to match the routing and bindings. Read the code to find where services currently call each other — hardcoded hostnames, localhost ports, internal base URLs, service-discovery config, docker-compose hostnames — and change them to read the bound variable, e.g.
await fetch(new URL('items/123', process.env.INVENTORY_URL)). Also reconcile the code with the public paths: if a service is mounted under a path prefix, make sure its routes and any client-side URLs agree with it. Bindings resolve at runtime in functions only — not during builds, and not in middleware. -
Confirm the details with me before you finish. The service names, the public rewrites, and the bindings in the snippet above are inferred and may be wrong. Show me the final
vercel.jsonand explicitly ask me to confirm:- the name of each service,
- which services should be public and on what path, and which should stay internal,
- the bindings you added, i.e. which service calls which.
Ask about anything you had to guess rather than assuming it.
Activity
github-actions commentedon Oct 26, 2026
Message that will be displayed on users' first issue