Configure CORSMiddleware for https://onboarding.skyheal.ai
This commit is contained in:
@@ -26,23 +26,16 @@ 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=["*"],
|
||||
)
|
||||
|
||||
|
||||
@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": "*",
|
||||
},
|
||||
expose_headers=["*"],
|
||||
)
|
||||
|
||||
app.include_router(onboarding_router)
|
||||
|
||||
Reference in New Issue
Block a user