deepreads / frontend /next.config.js
yash-b18
feat: combine frontend+backend into single HF Space
b4d23ab
raw
history blame contribute delete
503 Bytes
/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
async rewrites() {
return [
{
// Proxy /api/* → FastAPI backend.
// INTERNAL_API_URL is used in single-Space mode (Next.js and FastAPI co-located).
// Falls back to localhost:8001 for local development.
source: '/api/:path*',
destination: `${process.env.INTERNAL_API_URL || 'http://localhost:8001'}/:path*`,
},
];
},
};
module.exports = nextConfig;