2023-06-04 00:12:42 +03:00
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
|
|
|
|
origins = [
|
|
|
|
"http://localhost",
|
|
|
|
"http://localhost:3000",
|
2023-07-06 20:01:38 +03:00
|
|
|
"http://localhost:3001",
|
2023-06-04 00:12:42 +03:00
|
|
|
"https://quivr.app",
|
|
|
|
"https://www.quivr.app",
|
|
|
|
"http://quivr.app",
|
|
|
|
"http://www.quivr.app",
|
2024-02-26 05:09:01 +03:00
|
|
|
"https://chat.quivr.app",
|
2023-07-17 09:57:27 +03:00
|
|
|
"*",
|
2023-06-04 00:12:42 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
def add_cors_middleware(app):
|
|
|
|
app.add_middleware(
|
|
|
|
CORSMiddleware,
|
|
|
|
allow_origins=origins,
|
|
|
|
allow_credentials=True,
|
|
|
|
allow_methods=["*"],
|
|
|
|
allow_headers=["*"],
|
|
|
|
)
|