| 1234567891011121314151617181920212223242526272829 |
- """FastAPI application entry point.
- Importing this module must NOT require a live database connection (the engine is
- created lazily in :mod:`app.db.session`), so the OpenAPI schema can be exported
- offline.
- """
- from __future__ import annotations
- from fastapi import FastAPI
- from app.api.funnels import router as funnels_router
- app = FastAPI(
- title="hs-data API",
- version="0.1.0",
- description=(
- "Group-buy (拼团) funnel service over ads_trd_group_funnel_daily "
- "(single day, full history) + ads_trd_group_funnel_rolling (7d/30d)."
- ),
- )
- app.include_router(funnels_router)
- @app.get("/health", tags=["meta"])
- async def health() -> dict[str, str]:
- """Liveness probe. Does not touch the database."""
- return {"status": "ok"}
|