文件
csp/frontend/next.config.ts

22 行
643 B
TypeScript

import type { NextConfig } from "next";
const nextConfig: NextConfig = {
// For local dev convenience. In production you should configure reverse proxy
// and set NEXT_PUBLIC_API_BASE to your public API origin.
async rewrites() {
// Reverse proxy backend under a path prefix, so browser can access backend
// with same-origin (no CORS): http://<host>:7888/admin139/...
const backendInternal = process.env.BACKEND_INTERNAL_URL;
if (!backendInternal) return [];
return [
{
source: "/admin139/:path*",
destination: `${backendInternal}/:path*`,
},
];
},
};
export default nextConfig;