orgstate / infra /api /__init__.py
Legal-i's picture
Initial OrgState deploy via Stage 150 free-tier stack
d2d1903 verified
"""
infra.api — the HTTP API (Stage 3b).
A thin FastAPI shell over OrgStateService:
FastAPI app (app.py) -> handlers (handlers.py) -> OrgStateService
`handlers` and `errors` are pure (no fastapi dependency) and carry all the
real logic, so the API is fully unit-testable without a web server. `app`
needs fastapi/uvicorn (optional deps in requirements.txt).
"""
from . import errors, handlers
from .errors import ApiError
__all__ = ["errors", "handlers", "ApiError", "create_app"]
def create_app(db_path=None, **kwargs):
"""Lazy re-export of app.create_app so importing infra.api never requires
fastapi unless you actually build the app. ``**kwargs`` forwards
Stage 79+ extras like ``rate_limiter`` without re-declaring every
option in this thin wrapper."""
from .app import create_app as _create_app
return _create_app(db_path, **kwargs)