anycoder / frontend /next.config.js
AbuAlone09's picture
Update frontend/next.config.js
03232ae verified
raw
history blame contribute delete
521 Bytes
/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
reactStrictMode: true,
// Proxy cấu hình để frontend nói chuyện với backend
async rewrites() {
const API_HOST = process.env.BACKEND_HOST || 'http://localhost:8000';
return [
{
source: '/api/:path*',
destination: `${API_HOST}/api/:path*`,
},
{
source: '/ws/:path*',
destination: `${API_HOST}/ws/:path*`,
},
];
},
};
module.exports = nextConfig;