apiUrl builds url to planetposen-backend which prefixes localhost if dev

This commit is contained in:
2022-12-29 23:07:52 +01:00
parent 1fb3fdd502
commit e86f22fbe2

View File

@@ -5,8 +5,9 @@ const LOCALHOST_API = 'http://localhost:30010';
export function buildApiUrl(path: string) { export function buildApiUrl(path: string) {
let localhostApi = false; let localhostApi = false;
if (dev) localhostApi = true; if (dev) {
if (browser && window?.location?.href.includes('localhost')) { localhostApi = true;
} else if (browser && window?.location?.href.includes('localhost')) {
localhostApi = true; localhostApi = true;
} }