import type { NextConfig } from "next"; // In production the FastAPI server (port 8300) is the public entrypoint and reverse-proxies the // dashboard (this app, port 8301). In development (`pnpm dev`) we proxy /api and /v1 to the API. const API_URL = process.env.API_URL || "http://127.0.0.1:8300"; const nextConfig: NextConfig = { reactStrictMode: true, poweredByHeader: false, async rewrites() { if (process.env.NODE_ENV === "production") return []; return [ { source: "/api/:path*", destination: `${API_URL}/api/:path*` }, { source: "/v1/:path*", destination: `${API_URL}/v1/:path*` }, { source: "/health", destination: `${API_URL}/health` }, ]; }, }; export default nextConfig;