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 973b7da commit 82d0a2bCopy full SHA for 82d0a2b
fast_tmp/factory.py
@@ -1,5 +1,4 @@
1
from fastapi import FastAPI
2
-from starlette.middleware.cors import CORSMiddleware
3
4
from fast_tmp.admin.server import admin
5
from fast_tmp.conf import settings
@@ -11,18 +10,6 @@ def create_app() -> FastAPI:
11
10
:return: FastAPI
12
"""
13
app = FastAPI(debug=settings.DEBUG)
14
- # 注册app的位置
15
- if settings.BACKEND_CORS_ORIGINS:
16
- app.add_middleware(
17
- CORSMiddleware,
18
- allow_origins=[str(origin) for origin in settings.BACKEND_CORS_ORIGINS],
19
- allow_credentials=True,
20
- allow_methods=["*"],
21
- allow_headers=["*"],
22
- )
23
- # 在cookie存储session
24
- # app.add_middleware(SessionMiddleware, secret_key=settings.CAS_SESSION_SECRET)
25
-
26
app.mount("/admin", admin, name="admin")
27
28
return app
0 commit comments