import type { NextConfig } from "next"; const isDev = process.env.NODE_ENV === "development"; const nextConfig: NextConfig = { // Static export: the Python API (FastAPI StaticFiles, html=True) serves apps/web/out // with directory index.html fallback, so every route must end with a slash. output: "export", trailingSlash: true, images: { unoptimized: true }, reactStrictMode: true, poweredByHeader: false, // Dev only: proxy the API to the local FastAPI instance. Ignored by `next build` (static export). ...(isDev ? { async rewrites() { return [{ source: "/api/:path*", destination: "http://127.0.0.1:8600/api/:path*" }]; }, } : {}), }; export default nextConfig;