import type { NextConfig } from "next";
/**
* The browser talks to /api/* on the Next origin; this rewrite proxies it to
* jac-serve. Server components read JAC_SERVE_URL directly (lib/api.ts).
*/
const nextConfig: NextConfig = {
async rewrites() {
const target = process.env.JAC_SERVE_URL ?? "http://localhost:8787";
return [{ source: "/api/:path*", destination: `${target}/api/:path*` }];
},
};
export default nextConfig;