diff --git a/.env.example b/.env.example index 3cb19a1..c16bf61 100644 --- a/.env.example +++ b/.env.example @@ -1,4 +1,4 @@ -VITE_SERVER_ADDRESS = serveradress #ohne https und ohne pfad +VITE_SERVER_ADDRESS = backend_url #ohne pfad VITE_IMPRINT_LINK = https://mywebsite-imprint-url VITE_PRIVACY_LINK = https://mywebsite-privacy-url VITE_CUSTOM_LOGIN_MESSAGE = betrieben von xy diff --git a/README.md b/README.md index 5817b17..7619e76 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ services: restart: unless-stopped #environment: - # - SERVERADRESS= # wichtig: ohne https:// bzw http:// und ohne pfad + # - SERVERADDRESS= # wichtig: ohne pfad # - IMPRINTLINK=https://mywebsite-imprint-url # - PRIVACYLINK=https://mywebsite-privacy-url # - CUSTOMLOGINMESSAGE=betrieben von xy diff --git a/src/serverCom.ts b/src/serverCom.ts index 6e5c131..210406e 100644 --- a/src/serverCom.ts +++ b/src/serverCom.ts @@ -7,8 +7,8 @@ import { config } from "./config"; let devMode = process.env.NODE_ENV === "development"; -let host = devMode ? "localhost:5000" : (config.server_address ?? ""); -let url = devMode ? "http://" + host : (host ? "https://" : "") + host; +let host = devMode ? "localhost:5000" : (config.server_address ?? "").replace(/(^\w+:|^)\/\//, ""); +let url = devMode ? "http://" + host : config.server_address; const http = axios.create({ baseURL: url + "/api",