feat: Modus-Erkennung über window.location.hostname implementiert

- Automatische Umschaltung zwischen Entwicklungs- und Produktionsmodus
- Hostname-basierte Erkennung: localhost/127.0.0.1 → "dev", sonst → "production"
- fetchDigitalInputsService.ts entsprechend angepasst
- Erleichtert Entwicklung und reduziert manuelle .env-Konfiguration
This commit is contained in:
ISA
2025-07-09 09:45:49 +02:00
parent 14bd72756a
commit eca52f35cb
6 changed files with 20 additions and 6 deletions

View File

@@ -22,7 +22,9 @@ const parseCsvLabels = (line: string): string[] =>
line.split(",").map((v) => v.trim().replace(/^'+|'+$/g, ""));
export const fetchDigitalInputsService = async (): Promise<DigitalInput[]> => {
const mode = "production"; // ⛳ production oder json
const hostname = window.location.hostname;
const mode =
hostname === "localhost" || hostname === "127.0.0.1" ? "dev" : "production";
const url =
mode === "production"