Skip to content
Dashboard

Secure internal communication between services

, , Casey Gowrie, , James Clarke,
{
"services": {
"my_frontend": {
"root": "frontend/",
"framework": "nextjs",
"bindings": [
{
"type": "service",
"service": "my_backend",
"format": "url",
"env": "BACKEND_INTERNAL_URL"
}
]
},
"my_backend": {
"root": "backend/",
"entrypoint": "main:app"
}
}
}

app/api/users/route.ts
export async function GET() {
const url = new URL("/users", process.env.BACKEND_INTERNAL_URL);
const res = await fetch(url);
const users = await res.json();
return Response.json(users);
}

The frontend calls the backend using the injected internal URL. Traffic never leaves Vercel's network.

from fastapi import FastAPI
app = FastAPI()
@app.get("/users")
def get_users():
return [ ... ]

Copy link to headingUnder the hood

Copy link to headingObservability

Copy link to headingPricing

Copy link to headingLearn more

Ready to deploy?