main.py 768 B

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