refactor+docs: serverURL dynamisch, NEXT_PUBLIC_SERVER_URL entfernt (v1.1.76)

- config.js verwendet nun window.location und API_PORT_MODE zur URL-Ermittlung
- feste Konfiguration aus .env.local entfällt (bereinigt)
- neue Dokumentation: docs/frontend/config/config.md
- CHANGELOG.md aktualisiert (v1.1.76)
This commit is contained in:
Ismail Ali
2025-05-17 00:33:04 +02:00
parent 7b1d255432
commit 30bbb61f1c
6 changed files with 81 additions and 4 deletions

View File

@@ -1,2 +1,2 @@
// /config/appVersion
export const APP_VERSION = "1.1.76";
export const APP_VERSION = "1.1.77";

View File

@@ -7,7 +7,10 @@ const standardSideMenu = true;
const fullSideMenu = false;
// Server-URL aus Umgebungsvariable holen (nur bei echter API benötigt)
const serverURL = process.env.NEXT_PUBLIC_SERVER_URL || "";
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
const serverURL = mode === "dev" ? `${window.location.protocol}//${window.location.hostname}:80` : `${window.location.origin}`;
if (!serverURL && !isMockMode()) {
throw new Error("Die Umgebungsvariable NEXT_PUBLIC_SERVER_URL ist nicht gesetzt!");
}