This commit is contained in:
MarkLo 2025-11-21 21:28:58 +08:00
parent db3d5754de
commit b554ae71d5
1 changed files with 13 additions and 1 deletions

View File

@ -1,8 +1,20 @@
import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
output: 'standalone',
reactCompiler: true,
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://tradinaagents-backend.up.railway.app";
return [
{
source: "/api/:path*",
destination: `${backendUrl}/api/:path*`,
},
];
},
};
export default nextConfig;