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: '/:namespace(api|biz)/:path*', destination: `${backendOrigin}/:namespace/:path*`, }, ]; }, }; export default nextConfig;