We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a00e14d commit 43af1b1Copy full SHA for 43af1b1
ch08/planner/main.py
@@ -1,6 +1,7 @@
1
import uvicorn
2
from fastapi import FastAPI
3
from fastapi.responses import RedirectResponse
4
+from fastapi.middleware.cors import CORSMiddleware
5
6
from database.connection import Settings
7
from routes.events import event_router
@@ -10,8 +11,24 @@
10
11
12
settings = Settings()
13
14
+
15
+# register origins
16
17
+origins = ["*"]
18
19
+app.add_middleware(
20
+ CORSMiddleware,
21
+ allow_origins=origins,
22
+ allow_credentials=True,
23
+ allow_methods=["*"],
24
+ allow_headers=["*"],
25
+)
26
27
28
# Register routes
29
30
31
32
app.include_router(user_router, prefix="/user")
33
app.include_router(event_router, prefix="/event")
34
0 commit comments