import type { NextConfig } from 'next'; const backendOrigin = process.env.BACKEND_ORIGIN?.replace(/\/+$/, ''); if (!backendOrigin) { throw new Error('BACKEND_ORIGIN is required'); } const nextConfig: NextConfig = { reactStrictMode: false, async rewrites() { return [ { source: '/backend/:path*', destination: `${backendOrigin}/:path*`, }, ]; }, }; export default nextConfig;