generated from erangel1/generic-template
initial commit. phase 1 complete
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const DJANGO_URL = process.env.NEXT_PUBLIC_API_URL ?? "http://localhost:8000";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
// Proxy /backend/* requests to the Django API so the frontend never
|
||||
// exposes the backend origin to the browser (avoids CORS in production).
|
||||
async rewrites() {
|
||||
return [
|
||||
{
|
||||
source: "/backend/:path*",
|
||||
destination: `${DJANGO_URL}/:path*`,
|
||||
},
|
||||
];
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
Reference in New Issue
Block a user