6020021370
next.config rewrites() runs at build time — API_INTERNAL_URL is not set in CI, so the previous localhost:3001 fallback was baked into the bundle. Default to http://api:3001 which is always correct in Docker network. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
20 lines
485 B
TypeScript
20 lines
485 B
TypeScript
import type { NextConfig } from 'next';
|
|
import createNextIntlPlugin from 'next-intl/plugin';
|
|
|
|
const withNextIntl = createNextIntlPlugin('./src/i18n/request.ts');
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: 'standalone' as const,
|
|
async rewrites() {
|
|
const apiUrl = process.env.API_INTERNAL_URL || 'http://api:3001';
|
|
return [
|
|
{
|
|
source: '/api-proxy/:path*',
|
|
destination: `${apiUrl}/:path*`,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default withNextIntl(nextConfig);
|