Implement FIN-WP-0001-T06 HTTP runway read surface
Add create_runway_router() following the hub-core factory pattern, expose GET /runway/summary and /runway/monthly-burn via create_app, and add finhub serve for local operation.
This commit is contained in:
parent
0f2436b34c
commit
29dbaf1c2d
11 changed files with 270 additions and 4 deletions
33
src/fin_hub/app.py
Normal file
33
src/fin_hub/app.py
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
"""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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue