Shell Application for managing multiple Next.js zones under a single domain
Add the following variables to your .env.local file or Vercel project settings:
NEXT_PUBLIC_DEVTOOL_DOMAIN=https://dev-tool-d8y4.vercel.app/tools NEXT_PUBLIC_EIGHT_CONSTITUTION_DOMAIN=https://eight-constitution-test.vercel.app/
Each sub-project must set its basePath in next.config.js:
// In dev-tool-app/next.config.js
module.exports = {
basePath: '/dev-tool',
// ... other config
}To add a new zone, edit config/multi-zones.json:
[
{
"path": "new-app",
"envKey": "NEXT_PUBLIC_NEW_APP_DOMAIN"
}
]This Shell Application uses Next.js rewrites to proxy requests to independent Next.js applications (zones).
/dev-tool)