From b554ae71d5348ab1580aa1c52e4b550a2d5d0e8b Mon Sep 17 00:00:00 2001 From: MarkLo Date: Fri, 21 Nov 2025 21:28:58 +0800 Subject: [PATCH] --- frontend/next.config.ts | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/frontend/next.config.ts b/frontend/next.config.ts index 66e15661..fdbed71b 100644 --- a/frontend/next.config.ts +++ b/frontend/next.config.ts @@ -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;