Skip to content

Commit

Permalink
handle more base_urls
Browse files Browse the repository at this point in the history
  • Loading branch information
fzumstein committed Apr 30, 2024
1 parent 5ca6be7 commit 92b674c
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions app/routers/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,16 @@
async def manifest(request: Request):
if settings.hostname:
# Settings
if settings.hostname.startswith("https://"):
hostname = settings.hostname[8:]
else:
hostname = settings.hostname
base_url = f"https://{hostname}"
base_url = f"https://{settings.hostname}"
elif os.getenv("RENDER_EXTERNAL_URL"):
# Render
base_url = os.getenv("RENDER_EXTERNAL_URL")
elif os.getenv("WEBSITE_HOSTNAME"):
# Azure Functions
# Azure App Service
base_url = os.getenv("WEBSITE_HOSTNAME")
elif os.getenv("CODESPACES"):
# GitHub Codespaces
base_url = f"https://{os.getenv('CODESPACE_NAME')}-8000.{os.getenv('GITHUB_CODESPACES_PORT_FORWARDING_DOMAIN')}"
else:
# Mostly localhost
base_url = request.base_url
Expand Down

0 comments on commit 92b674c

Please sign in to comment.