Files
goodpackagerepo/frontend/next.config.js

34 lines
795 B
JavaScript

/** @type {import('next').NextConfig} */
const nextConfig = {
output: 'standalone',
async rewrites() {
// Get backend URL from environment, fallback to localhost for development
const backendUrl = process.env.BACKEND_URL || 'http://localhost:5000';
return [
{
source: '/auth/:path*',
destination: `${backendUrl}/auth/:path*`,
},
{
source: '/v1/:path*',
destination: `${backendUrl}/v1/:path*`,
},
{
source: '/admin/:path*',
destination: `${backendUrl}/admin/:path*`,
},
{
source: '/health',
destination: `${backendUrl}/health`,
},
{
source: '/schema',
destination: `${backendUrl}/schema`,
},
];
},
}
module.exports = nextConfig