29 lines
644 B
Python
29 lines
644 B
Python
from __future__ import annotations
|
|
|
|
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from cpv3.infrastructure.settings import get_settings
|
|
from cpv3.api.v1.router import api_router
|
|
|
|
settings = get_settings()
|
|
|
|
app = FastAPI(
|
|
title="Coffee Project Backend API",
|
|
version="0.0.0",
|
|
openapi_url="/api/schema/",
|
|
docs_url="/api/schema/swagger/",
|
|
redoc_url=None,
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.cors_allowed_origins,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
# Include the versioned API router
|
|
app.include_router(api_router)
|