From 6579f60d7d6be9509731b018df98e13870b880b8 Mon Sep 17 00:00:00 2001 From: ajaysi Date: Sat, 4 Apr 2026 18:25:19 +0530 Subject: [PATCH] fix: add current Vercel deployment to CORS allowed origins --- backend/app.py | 11 +++++++++++ 1 file changed, 11 insertions(+) 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: