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) {
let localhostApi = false;
if (dev) localhostApi = true;
if (browser && window?.location?.href.includes('localhost')) {
if (dev) {
localhostApi = true;
} else if (browser && window?.location?.href.includes('localhost')) {
localhostApi = true;
}