services / next.config.js
vish85521's picture
Upload 18 files
6a44dcb verified
raw
history blame contribute delete
610 Bytes
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
// Required for the standalone Docker output used in Hugging Face Spaces
output: 'standalone',
async rewrites() {
// Use NEXT_PUBLIC_API_URL for HF Spaces / production,
// fall back to localhost for local development
const backendUrl = process.env.NEXT_PUBLIC_API_URL || 'http://127.0.0.1:8001';
return [
{
source: '/api/:path*',
destination: `${backendUrl}/:path*`,
},
];
},
};
module.exports = nextConfig;