diff --git a/src/StreamMaster.WebUI/lib/settings.ts b/src/StreamMaster.WebUI/lib/settings.ts index 0eef23763..40d9f56d3 100644 --- a/src/StreamMaster.WebUI/lib/settings.ts +++ b/src/StreamMaster.WebUI/lib/settings.ts @@ -1,19 +1,19 @@ // settings.ts -export const isClient = typeof window !== 'undefined'; +export const isClient = typeof window !== "undefined"; -export const isDev = process.env.NODE_ENV === 'development'; +export const isDev = process.env.NODE_ENV === "development"; const loadConfig = () => { - const request = new XMLHttpRequest(); - request.open('GET', '/config.json', false); // Synchronous request - request.send(null); + const request = new XMLHttpRequest(); + request.open("GET", "/config.json", false); // Synchronous request + request.send(null); - if (request.status === 200) { - return JSON.parse(request.responseText); - } else { - throw new Error(`Failed to load config: ${request.status}`); - } + if (request.status === 200) { + return JSON.parse(request.responseText); + } else { + throw new Error(`Failed to load config: ${request.status}`); + } }; const config = loadConfig(); @@ -21,4 +21,7 @@ const config = loadConfig(); export const defaultPort = config.defaultPort; export const defaultBaseUrl = config.defaultBaseUrl; -export const baseHostURL = isClient && !isDev ? `${window.location.protocol}//${window.location.host}` : `http://127.0.0.1:${defaultPort}${defaultBaseUrl}`; +export const baseHostURL = + isClient && !isDev + ? `${window.location.protocol}//${window.location.host}` + : `http://localhost:${defaultPort}${defaultBaseUrl}`;