|
|
@ -1,5 +1,6 @@
|
|
|
|
import uvicorn
|
|
|
|
import uvicorn
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from fastapi import FastAPI
|
|
|
|
|
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
|
|
|
|
|
|
|
|
from server.routers_init import all_routers
|
|
|
|
from server.routers_init import all_routers
|
|
|
|
|
|
|
|
|
|
|
@ -8,6 +9,16 @@ app = FastAPI(
|
|
|
|
docs_url='/api/docs'
|
|
|
|
docs_url='/api/docs'
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
origins = ["*"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.add_middleware(
|
|
|
|
|
|
|
|
CORSMiddleware,
|
|
|
|
|
|
|
|
allow_origins=origins,
|
|
|
|
|
|
|
|
allow_credentials=True,
|
|
|
|
|
|
|
|
allow_methods=["*"],
|
|
|
|
|
|
|
|
allow_headers=["*"],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
for router in all_routers:
|
|
|
|
for router in all_routers:
|
|
|
|
app.include_router(router)
|
|
|
|
app.include_router(router)
|
|
|
|
|
|
|
|
|
|
|
|