snapdirect/src/main.py

25 lines
536 B
Python
Raw Normal View History

2026-03-08 12:51:47 +00:00
from contextlib import asynccontextmanager
from typing import AsyncGenerator
from fastapi import FastAPI
from src.config import app_configs
from src.snapshots.router import router as snapshots_router
@asynccontextmanager
async def lifespan(_application: FastAPI) -> AsyncGenerator:
# Startup
yield
# Shutdown
app = FastAPI(**app_configs, lifespan=lifespan)
app.include_router(snapshots_router)
@app.get("/healthcheck", include_in_schema=False)
async def healthcheck() -> dict[str, str]:
return {"status": "ok"}