diff --git a/backend/app.py b/backend/app.py index 0501d5bc..786f56e1 100644 --- a/backend/app.py +++ b/backend/app.py @@ -184,12 +184,23 @@ default_allowed_origins = [ "http://localhost:8000", # Backend dev server "http://localhost:3001", # Alternative React port "https://alwrity-ai.vercel.app", # Vercel frontend + "https://alwrity-5vac2n9su-ajsis-projects.vercel.app", # Current Vercel deployment + "https://alwrity.vercel.app", # Vercel app ] # Optional dynamic origins from environment (comma-separated) env_origins = os.getenv("ALWRITY_ALLOWED_ORIGINS", "").split(",") if os.getenv("ALWRITY_ALLOWED_ORIGINS") else [] env_origins = [o.strip() for o in env_origins if o.strip()] +# Convenience: NGROK_URL env var (single origin) +ngrok_origin = os.getenv("NGROK_URL") +if ngrok_origin: + env_origins.append(ngrok_origin.strip()) + +# Optional dynamic origins from environment (comma-separated) +env_origins = os.getenv("ALWRITY_ALLOWED_ORIGINS", "").split(",") if os.getenv("ALWRITY_ALLOWED_ORIGINS") else [] +env_origins = [o.strip() for o in env_origins if o.strip()] + # Convenience: NGROK_URL env var (single origin) ngrok_origin = os.getenv("NGROK_URL") if ngrok_origin: