Skip to content

Commit 5620da2

Browse files
authored
Add CORS middleware
1 parent 514c5bb commit 5620da2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

app/main.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ class Sources(str, enum.Enum):
4747
# Middleware
4848
#######################
4949

50+
APP.add_middleware(
51+
fastapi.middleware.cors.CORSMiddleware,
52+
allow_credentials=True,
53+
allow_origins=['*'],
54+
allow_methods=['*'],
55+
allow_headers=['*'],
56+
)
5057

5158
# TODO this could probably just be a FastAPI dependency.
5259
@APP.middleware('http')

0 commit comments

Comments
 (0)