fix: environment variable API_URL can't be changed

This commit is contained in:
Elias Schneider
2024-10-18 16:07:32 +02:00
parent 958b79d787
commit fe085b58a5
5 changed files with 11 additions and 17 deletions

View File

@@ -1,6 +1,5 @@
import { NextApiRequest, NextApiResponse } from "next";
import httpProxyMiddleware from "next-http-proxy-middleware";
import getConfig from "next/config";
export const config = {
api: {
@@ -9,7 +8,7 @@ export const config = {
},
};
const { apiURL } = getConfig().serverRuntimeConfig;
const apiURL = process.env.API_URL || "http://localhost:8080";
// A proxy to the API server only used in development.
// In production this route gets overridden by Caddy.