liberal CORS

This commit is contained in:
boyska 2021-10-09 20:39:33 +02:00
parent a6090dbdb2
commit 6fbaf2861e

View file

@ -10,6 +10,7 @@ from starlette.websockets import WebSocketDisconnect
from fastapi.security import HTTPBasic, HTTPBasicCredentials
from fastapi.encoders import jsonable_encoder
from fastapi.staticfiles import StaticFiles
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel
@ -83,6 +84,16 @@ class Manager:
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=['*'],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.mount("/static", StaticFiles(directory="static"), name="static")
manager = Manager()
counter_store = Store(