File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1+ import html
12import os
23
34import uvicorn
@@ -36,8 +37,12 @@ async def serve_index():
3637
3738@app .get ("/config" )
3839async def get_config ():
40+ backend_url = html .escape (os .getenv ("BACKEND_API_URL" , "http://localhost:8000" ))
41+ auth_enabled = html .escape (os .getenv ("AUTH_ENABLED" , "false" ))
42+ backend_url = backend_url + "/api"
43+
3944 config = {
40- "API_URL" : os . getenv ( "API_URL" , "API_URL not set" ) ,
45+ "API_URL" : backend_url ,
4146 "REACT_APP_MSAL_AUTH_CLIENTID" : os .getenv (
4247 "REACT_APP_MSAL_AUTH_CLIENTID" , "Client ID not set"
4348 ),
@@ -50,7 +55,7 @@ async def get_config():
5055 "REACT_APP_MSAL_POST_REDIRECT_URL" : os .getenv (
5156 "REACT_APP_MSAL_POST_REDIRECT_URL" , "Post Redirect URL not set"
5257 ),
53- "ENABLE_AUTH" : os . getenv ( "ENABLE_AUTH" , "false" ) ,
58+ "ENABLE_AUTH" : auth_enabled ,
5459 }
5560 return config
5661
You can’t perform that action at this time.
0 commit comments