This commit is contained in:
MarkLo 2025-11-21 12:15:44 +08:00
parent 16ef624551
commit d228db5f78
1 changed files with 5 additions and 1 deletions

View File

@ -1,10 +1,14 @@
const nextConfig = {
output: 'standalone',
async rewrites() {
// Use BACKEND_URL env var, or fallback to public Railway URL
// In Railway, services cannot use simple hostnames to communicate
const backendUrl = process.env.BACKEND_URL || "https://tradingagents-backend.up.railway.app";
return [
{
source: "/api/:path*",
destination: `${process.env.API_URL || "http://backend:8000"}/api/:path*`,
destination: `${backendUrl}/api/:path*`,
},
];
},