| |
| const nextConfig = { |
| output: 'standalone', |
| reactStrictMode: true, |
| |
| |
| ...(process.env.NEXT_PUBLIC_API_URL && { |
| env: { |
| NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL, |
| }, |
| }), |
| async rewrites() { |
| |
| |
| const API_HOST = process.env.BACKEND_HOST || 'http://localhost:8000'; |
| console.log(`[Next.js] Setting up API proxy: /api/* -> ${API_HOST}/api/*`); |
| return [ |
| { |
| source: '/api/:path*', |
| destination: `${API_HOST}/api/:path*`, |
| }, |
| { |
| source: '/ws/:path*', |
| destination: `${API_HOST}/ws/:path*`, |
| }, |
| ]; |
| }, |
| } |
|
|
| module.exports = nextConfig |
|
|
|
|