fix: use conditionally the right url for backend in nextjs frontend

This commit is contained in:
theoleuthardt 2025-02-28 15:14:22 +01:00
parent 2c7043eec6
commit a3e7998d11
4 changed files with 13 additions and 5 deletions

View file

@ -1,9 +1,14 @@
import type { NextConfig } from "next";
const NEXT_PUBLIC_BACKEND_URL =
process.env.NODE_ENV === "production"
? process.env.NEXT_PUBLIC_BACKEND_URL || ""
: "http://localhost:4000";
const nextConfig: NextConfig = {
output: "standalone",
env: {
NEXT_PUBLIC_BACKEND_URL: process.env.NEXT_PUBLIC_BACKEND_URL,
NEXT_PUBLIC_BACKEND_URL: NEXT_PUBLIC_BACKEND_URL,
},
};