- Add standalone output mode in next.config.mjs - Configure environment variables with .env.example - Update staticwebapp.config.json with proper routing and fallback - Optimize GitHub Actions workflow with npm cache and env vars - Set output_location to .next/standalone for SWA deployment - Preserve all business logic in API client, auth, and components
42 lines
896 B
JSON
42 lines
896 B
JSON
{
|
|
"navigationFallback": {
|
|
"rewrite": "/index.html",
|
|
"exclude": ["/_next/*", "/static/*", "/public/*", "/*.{css,js,json,ico,png,jpg,svg,woff,woff2}"]
|
|
},
|
|
"platform": {
|
|
"apiRuntime": "node:20"
|
|
},
|
|
"routes": [
|
|
{
|
|
"route": "/api/*",
|
|
"allowedRoles": ["anonymous", "authenticated"]
|
|
},
|
|
{
|
|
"route": "/admin/*",
|
|
"allowedRoles": ["anonymous", "authenticated"]
|
|
},
|
|
{
|
|
"route": "/channel/*",
|
|
"allowedRoles": ["anonymous", "authenticated"]
|
|
},
|
|
{
|
|
"route": "/*",
|
|
"allowedRoles": ["anonymous", "authenticated"]
|
|
}
|
|
],
|
|
"responseOverrides": {
|
|
"404": {
|
|
"rewrite": "/index.html",
|
|
"statusCode": 200
|
|
}
|
|
},
|
|
"globalHeaders": {
|
|
"cache-control": "no-cache, no-store, must-revalidate"
|
|
},
|
|
"mimeTypes": {
|
|
".json": "application/json",
|
|
".js": "text/javascript",
|
|
".css": "text/css"
|
|
}
|
|
}
|