diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts index f463cc42..afc2b722 100644 --- a/apps/web/next.config.ts +++ b/apps/web/next.config.ts @@ -4,19 +4,20 @@ const nextConfig: NextConfig = { output: 'standalone', async rewrites() { - // In production, API calls go to same origin - // In dev, proxy to local backend - const apiBase = process.env.NEXT_PUBLIC_API_BASE_URL || '' + // INTERNAL_API_URL is the backend service URL (city-service) + // Used for proxying API requests from the frontend to the backend + const internalApiUrl = process.env.INTERNAL_API_URL || 'http://localhost:7001' - if (apiBase && apiBase !== '') { - return [ - { - source: '/api/:path*', - destination: `${apiBase}/api/:path*`, - }, - ] - } - return [] + return [ + { + source: '/api/v1/:path*', + destination: `${internalApiUrl}/api/v1/:path*`, + }, + { + source: '/api/:path*', + destination: `${internalApiUrl}/api/:path*`, + }, + ] }, }