From 15e8b2dfeca82250be43ce81538b3b6c039d1297 Mon Sep 17 00:00:00 2001 From: Gokulvarthan Ramesh Date: Sat, 29 Aug 2026 17:56:11 +0530 Subject: [PATCH] Configure CORSMiddleware for https://onboarding.skyheal.ai --- ai-patient-onboarding/app/main.py | 23 ++++++++--------------- 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/ai-patient-onboarding/app/main.py b/ai-patient-onboarding/app/main.py index 44291bf..26c9376 100644 --- a/ai-patient-onboarding/app/main.py +++ b/ai-patient-onboarding/app/main.py @@ -26,25 +26,18 @@ app = FastAPI( # Enable CORS for React Web & Mobile clients app.add_middleware( CORSMiddleware, - allow_origins=["*"], - allow_credentials=False, + allow_origins=[ + "https://onboarding.skyheal.ai", + "http://localhost:5173", + "http://127.0.0.1:5173", + "*", + ], + allow_credentials=True, allow_methods=["*"], allow_headers=["*"], + expose_headers=["*"], ) - -@app.options("/{full_path:path}") -async def options_preflight(full_path: str): - from fastapi import Response, status - return Response( - status_code=status.HTTP_204_NO_CONTENT, - headers={ - "Access-Control-Allow-Origin": "*", - "Access-Control-Allow-Methods": "GET, POST, PUT, DELETE, OPTIONS", - "Access-Control-Allow-Headers": "*", - }, - ) - app.include_router(onboarding_router) app.include_router(voice_router) app.include_router(documents_router)