fix: allow server address as url without path
This commit is contained in:
parent
f74c10d4aa
commit
2176c6c3cf
3 changed files with 4 additions and 4 deletions
|
@ -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_IMPRINT_LINK = https://mywebsite-imprint-url
|
||||||
VITE_PRIVACY_LINK = https://mywebsite-privacy-url
|
VITE_PRIVACY_LINK = https://mywebsite-privacy-url
|
||||||
VITE_CUSTOM_LOGIN_MESSAGE = betrieben von xy
|
VITE_CUSTOM_LOGIN_MESSAGE = betrieben von xy
|
||||||
|
|
|
@ -31,7 +31,7 @@ services:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
|
||||||
#environment:
|
#environment:
|
||||||
# - SERVERADRESS=<backend_host> # wichtig: ohne https:// bzw http:// und ohne pfad
|
# - SERVERADDRESS=<backend_url (https://... | http://...)> # wichtig: ohne pfad
|
||||||
# - IMPRINTLINK=https://mywebsite-imprint-url
|
# - IMPRINTLINK=https://mywebsite-imprint-url
|
||||||
# - PRIVACYLINK=https://mywebsite-privacy-url
|
# - PRIVACYLINK=https://mywebsite-privacy-url
|
||||||
# - CUSTOMLOGINMESSAGE=betrieben von xy
|
# - CUSTOMLOGINMESSAGE=betrieben von xy
|
||||||
|
|
|
@ -7,8 +7,8 @@ import { config } from "./config";
|
||||||
|
|
||||||
let devMode = process.env.NODE_ENV === "development";
|
let devMode = process.env.NODE_ENV === "development";
|
||||||
|
|
||||||
let host = devMode ? "localhost:5000" : (config.server_address ?? "");
|
let host = devMode ? "localhost:5000" : (config.server_address ?? "").replace(/(^\w+:|^)\/\//, "");
|
||||||
let url = devMode ? "http://" + host : (host ? "https://" : "") + host;
|
let url = devMode ? "http://" + host : config.server_address;
|
||||||
|
|
||||||
const http = axios.create({
|
const http = axios.create({
|
||||||
baseURL: url + "/api",
|
baseURL: url + "/api",
|
||||||
|
|
Loading…
Reference in a new issue