Next.js + FastAPI
// vercel.json
{
"services": {
"frontend": {
"root": "frontend/",
"framework": "nextjs"
},
"backend": {
"root": "backend/",
"entrypoint": "main:app"
}
},
"rewrites": [
{ "source": "/svc/api/:path*", "destination": { "service": "backend" } },
{ "source": "/(.*)", "destination": { "service": "frontend" } }
]
}Next.js API Route
Calls /api/hello, a route handler running on the Next.js frontend service.
FastAPI Backend Route
Calls /svc/api/status directly on the FastAPI backend service.