odapi/app/__init__.py

15 lines
330 B
Python
Raw Permalink Normal View History

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
2020-09-03 18:31:52 +02:00
from app.routes import router
from constants import ORIGINS
2020-03-23 21:17:16 +01:00
app = FastAPI()
2020-09-03 18:31:52 +02:00
app.include_router(router)
app.add_middleware(
CORSMiddleware,
allow_origins=ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)