update cors

main
Nikita 1 year ago committed by GitHub
parent 9080b17f68
commit 44b2ba831f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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

Loading…
Cancel
Save