From 3af4af101196918477d72a3bdad217addeb48790 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikolas=20G=C3=B6rlitz?= Date: Thu, 11 Apr 2024 14:51:18 +0200 Subject: [PATCH] automatically switch host on prod --- frontend/src/core/Config.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/core/Config.ts b/frontend/src/core/Config.ts index 3741462..e9728e0 100644 --- a/frontend/src/core/Config.ts +++ b/frontend/src/core/Config.ts @@ -8,13 +8,15 @@ dayjs.extend(utc); dayjs.extend(relativeTime); dayjs.extend(duration); +const DEV_ENV = import.meta.env.MODE; + export const Config = { VERSION: "0.0.1-Beta", VATGER_BROWSER_TOKEN_NAME: "vatger_tc_browser_token", VATGER_LOGIN_LANGUAGE_NAME: "vatger_login_language", - APP_HOST: "https://tc-dev.vatsim-germany.org", - API_BASE_URL: "https://tc-api-dev.vatsim-germany.org", + APP_HOST: DEV_ENV ? "http://localhost:8000" : "https://tc-dev.vatsim-germany.org", + API_BASE_URL: DEV_ENV ? "http://localhost:8001/api/v1" : "https://tc-dev.vatsim-germany.org/api/v1", DATE_FORMAT: "DD.MM.YYYY", DATETIME_FORMAT: "DD.MM.YYYY HH:mm",