31 lines
713 B
Python
31 lines
713 B
Python
from fastapi import FastAPI
|
|
from fastapi.middleware.cors import CORSMiddleware
|
|
|
|
from app.core.config import get_settings
|
|
from app.core.logging import configure_logging
|
|
|
|
settings = get_settings()
|
|
configure_logging(settings.log_level)
|
|
|
|
app = FastAPI(
|
|
title=settings.app_name,
|
|
version=settings.app_version,
|
|
debug=settings.debug,
|
|
)
|
|
|
|
app.add_middleware(
|
|
CORSMiddleware,
|
|
allow_origins=settings.allowed_origins,
|
|
allow_credentials=True,
|
|
allow_methods=["*"],
|
|
allow_headers=["*"],
|
|
)
|
|
|
|
|
|
@app.get("/api/health", tags=["health"])
|
|
async def health_check() -> dict[str, str]:
|
|
return {
|
|
"status": "ok",
|
|
"service": settings.app_name,
|
|
"version": settings.app_version,
|
|
} |