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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user