1import type { NextConfig } from "next";23// In production the FastAPI server (port 8300) is the public entrypoint and reverse-proxies the4// dashboard (this app, port 8301). In development (`pnpm dev`) we proxy /api and /v1 to the API.5const API_URL = process.env.API_URL || "http://127.0.0.1:8300";67const nextConfig: NextConfig = {8 reactStrictMode: true,9 poweredByHeader: false,10 async rewrites() {11 if (process.env.NODE_ENV === "production") return [];12 return [13 { source: "/api/:path*", destination: `${API_URL}/api/:path*` },14 { source: "/v1/:path*", destination: `${API_URL}/v1/:path*` },15 { source: "/health", destination: `${API_URL}/health` },16 ];17 },18};1920export default nextConfig;21