2023-04-01 16:19:12 +02:00
|
|
|
from fastapi import FastAPI
|
|
|
|
from .router import router
|
2023-04-01 20:13:11 +02:00
|
|
|
from .settings import Settings
|
|
|
|
from fastapi.middleware.cors import CORSMiddleware
|
2023-04-01 16:19:12 +02:00
|
|
|
|
|
|
|
|
|
|
|
app = FastAPI(title="Fooder")
|
|
|
|
app.include_router(router)
|
2023-04-01 20:13:11 +02:00
|
|
|
|
|
|
|
|
|
|
|
app.add_middleware(
|
|
|
|
CORSMiddleware,
|
|
|
|
allow_origins=Settings().ALLOWED_ORIGINS,
|
|
|
|
allow_credentials=True,
|
|
|
|
allow_methods=["*"],
|
|
|
|
allow_headers=["*"],
|
|
|
|
)
|