24 lines
536 B
Python
24 lines
536 B
Python
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"}
|