mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-01-17 19:28:27 -05:00
15 lines
346 B
JavaScript
15 lines
346 B
JavaScript
function getApiBase()
|
|
{
|
|
let apiBase = getSetting("BACKEND_API_URL");
|
|
|
|
if(apiBase == "")
|
|
{
|
|
const protocol = window.location.protocol.replace(':', '');
|
|
const host = window.location.hostname;
|
|
const port = getSetting("GRAPHQL_PORT");
|
|
|
|
apiBase = `${protocol}://${host}:${port}`;
|
|
}
|
|
|
|
return apiBase;
|
|
} |