import type { NextConfig } from "next"; // Everything under /api is the backend (docs/ACCOUNTS-1.0-PLAN.md ยง1). On a server nginx sends it // there; in development (and when Next is reached directly) this rewrite does. const api = (process.env.ACCOUNTS_API_URL || "http://127.0.0.1:5200").replace(/\/+$/, ""); const nextConfig: NextConfig = { poweredByHeader: false, transpilePackages: ["@crosscode/ui"], async rewrites() { return [{ source: "/api/:path*", destination: `${api}/api/:path*` }]; }, async headers() { return [{ source: "/:path*", headers: [ { key: "X-Robots-Tag", value: "noindex, nofollow" }, { key: "Referrer-Policy", value: "same-origin" }, { key: "X-Content-Type-Options", value: "nosniff" }, ], }]; }, }; export default nextConfig;