Files

17 lines
424 B
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
// 将 /api/* 代理到 NestJS 后端,避免浏览器跨域并统一前端调用路径。
async rewrites() {
const backend = process.env.BACKEND_URL ?? 'http://localhost:3000';
return [
{
source: '/api/:path*',
destination: `${backend}/api/:path*`,
},
];
},
};
export default nextConfig;