20 lines
492 B
TypeScript
20 lines
492 B
TypeScript
import type { NextConfig } from "next";
|
|
|
|
// Use NEXT_PUBLIC_API_URL for local dev (http://localhost:8000),
|
|
// fall back to the Docker-internal service name for containerised deployments.
|
|
const API_BASE = process.env.NEXT_PUBLIC_API_URL || "http://backend:8000";
|
|
|
|
const nextConfig: NextConfig = {
|
|
output: "standalone",
|
|
async rewrites() {
|
|
return [
|
|
{
|
|
source: "/api/:path*",
|
|
destination: `${API_BASE}/api/:path*`,
|
|
},
|
|
];
|
|
},
|
|
};
|
|
|
|
export default nextConfig;
|