33 lines
774 B
Python
33 lines
774 B
Python
|
|
"""Fin-hub FastAPI application factory."""
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from fastapi import FastAPI
|
||
|
|
from pydantic import BaseModel
|
||
|
|
|
||
|
|
from fin_hub import __version__
|
||
|
|
from fin_hub.routers import create_runway_router
|
||
|
|
|
||
|
|
|
||
|
|
class HealthResponse(BaseModel):
|
||
|
|
service: str
|
||
|
|
status: str
|
||
|
|
version: str
|
||
|
|
|
||
|
|
|
||
|
|
def create_app() -> FastAPI:
|
||
|
|
app = FastAPI(
|
||
|
|
title="Fin Hub API",
|
||
|
|
version=__version__,
|
||
|
|
description="Read surfaces for runway projection and monthly burn.",
|
||
|
|
)
|
||
|
|
|
||
|
|
@app.get("/healthz", response_model=HealthResponse, tags=["system"])
|
||
|
|
def healthz() -> HealthResponse:
|
||
|
|
return HealthResponse(service="fin-hub", status="ok", version=__version__)
|
||
|
|
|
||
|
|
app.include_router(create_runway_router())
|
||
|
|
return app
|
||
|
|
|
||
|
|
|
||
|
|
app = create_app()
|