mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-03 08:41:35 -07:00
FE+BE: BACKEND_API_URL for reverse proxies #1390
Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
15
front/js/api.js
Normal file
15
front/js/api.js
Normal file
@@ -0,0 +1,15 @@
|
||||
function getApiBase()
|
||||
{
|
||||
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;
|
||||
}
|
||||
Reference in New Issue
Block a user