This commit is contained in:
parent
987e757d8c
commit
29e53034bb
|
|
@ -7,8 +7,11 @@ const nextConfig: NextConfig = {
|
|||
// In development: use localhost backend
|
||||
// In production (Railway): use BACKEND_URL env var or fallback to Railway URL
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
// Default to http://backend:8000 in production (Docker) if not set
|
||||
const backendUrl = process.env.BACKEND_URL ||
|
||||
(isDev ? "http://localhost:8000" : "https://tradingagents-backend.up.railway.app");
|
||||
(isDev ? "http://localhost:8000" : "http://backend:8000");
|
||||
|
||||
console.log(`[Next.js] Rewriting API requests to: ${backendUrl}`);
|
||||
|
||||
return [
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue