FE+BE: BACKEND_API_URL for reverse proxies #1390

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2026-01-09 14:20:25 +11:00
parent 77803c18be
commit 0f1b19bddc
28 changed files with 75 additions and 30 deletions

15
front/js/api.js Normal file
View 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;
}