fix: Add proper Next.js rewrites for agent/microdao API
- /api/agents/:agentId/dashboard -> /city/agents/:agentId/dashboard - /api/microdao/* -> /city/microdao/* - /api/public/* -> /public/* - /api/city/* -> /city/* Fixes 404 errors on agent/microdao cabinet pages
This commit is contained in:
@@ -12,13 +12,35 @@ const nextConfig: NextConfig = {
|
||||
console.log('[next.config] INTERNAL_API_URL:', internalApiUrl)
|
||||
|
||||
return [
|
||||
// Agent dashboard API -> /city/agents
|
||||
{
|
||||
source: '/api/agents/:agentId/dashboard',
|
||||
destination: `${internalApiUrl}/city/agents/:agentId/dashboard`,
|
||||
},
|
||||
// Microdao API -> /city/microdao
|
||||
{
|
||||
source: '/api/microdao/:path*',
|
||||
destination: `${internalApiUrl}/city/microdao/:path*`,
|
||||
},
|
||||
// Public API -> /public
|
||||
{
|
||||
source: '/api/public/:path*',
|
||||
destination: `${internalApiUrl}/public/:path*`,
|
||||
},
|
||||
// City API -> /city
|
||||
{
|
||||
source: '/api/city/:path*',
|
||||
destination: `${internalApiUrl}/city/:path*`,
|
||||
},
|
||||
// Governance/Audit/Incidents -> /api/v1
|
||||
{
|
||||
source: '/api/v1/:path*',
|
||||
destination: `${internalApiUrl}/api/v1/:path*`,
|
||||
},
|
||||
// Fallback for other /api routes
|
||||
{
|
||||
source: '/api/:path*',
|
||||
destination: `${internalApiUrl}/api/:path*`,
|
||||
destination: `${internalApiUrl}/:path*`,
|
||||
},
|
||||
]
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user