Skip to content

Commit af541b0

Browse files
committed
update CORS
1 parent 74f59db commit af541b0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/main.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from fastapi import FastAPI, Depends
2+
from fastapi.middleware.cors import CORSMiddleware
23

34
from app.config import settings
45
from app.router_manager import RouterManager
@@ -27,6 +28,14 @@
2728
description=description
2829
)
2930

31+
app.add_middleware(
32+
CORSMiddleware,
33+
allow_origins=["*"],
34+
allow_credentials=True,
35+
allow_methods=["*"],
36+
allow_headers=["*"],
37+
)
38+
3039
router_manager = RouterManager(app)
3140
router_manager.install_initial_routes()
3241

0 commit comments

Comments
 (0)