Skip to content

Commit

Permalink
Cannot use bare slash "/" as root_path in a Fast-API app.
Browse files Browse the repository at this point in the history
  • Loading branch information
ashleysommer committed Aug 16, 2024
1 parent d644e86 commit 2a4595b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion function_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@

# This is the base URL path that Prez routes will stem from
# must _start_ in a slash, but _not end_ in slash, eg: /prez
env_root_path: str = os.getenv("FUNCTION_APP_ROOT_PATH", "/")
env_root_path: str = os.getenv("FUNCTION_APP_ROOT_PATH", "")
ROOT_PATH: str = env_root_path.strip()
# Note, must be _empty_ string for no path prefix (not "/")
if ROOT_PATH == "/":
ROOT_PATH = ""
env_auth_level: str = os.getenv("FUNCTION_APP_AUTH_LEVEL", "FUNCTION")
env_auth_level = env_auth_level.strip().upper()
if env_auth_level == "ADMIN":
Expand Down

0 comments on commit 2a4595b

Please sign in to comment.