29 lines
733 B
TypeScript
29 lines
733 B
TypeScript
import type { NextConfig } from 'next'
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: 'standalone',
|
|
|
|
async rewrites() {
|
|
// For Docker network: use service name
|
|
// INTERNAL_API_URL should be set to http://daarion-city-service:7001 in docker
|
|
// Fallback to localhost for local development
|
|
const internalApiUrl = process.env.INTERNAL_API_URL || 'http://daarion-city-service:7001'
|
|
|
|
console.log('[next.config] INTERNAL_API_URL:', internalApiUrl)
|
|
|
|
return [
|
|
{
|
|
source: '/api/v1/:path*',
|
|
destination: `${internalApiUrl}/api/v1/:path*`,
|
|
},
|
|
{
|
|
source: '/api/:path*',
|
|
destination: `${internalApiUrl}/api/:path*`,
|
|
},
|
|
]
|
|
},
|
|
}
|
|
|
|
export default nextConfig
|
|
|