doc-forge-reds/backend/app/main.py

30 lines
684 B
Python

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.core.config import get_settings
from app.core.security_middleware import SecurityMiddleware
from app.api.router import api_router
settings = get_settings()
app = FastAPI(
title=settings.PROJECT_NAME,
openapi_url=f"{settings.API_V1_PREFIX}/openapi.json",
)
app.add_middleware(
CORSMiddleware,
allow_origins=settings.CORS_ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.add_middleware(SecurityMiddleware)
app.include_router(api_router)
@app.get("/health")
async def health_check():
return {"status": "ok", "version": "0.1.0"}