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:
tegwick 2026-07-08 22:46:24 +02:00
parent 0f2436b34c
commit 29dbaf1c2d
11 changed files with 270 additions and 4 deletions

View file

@ -136,6 +136,19 @@ def _cmd_evaluate(args: argparse.Namespace) -> int:
return 0
def _cmd_serve(args: argparse.Namespace) -> int:
import uvicorn
uvicorn.run(
"fin_hub.app:create_app",
factory=True,
host=args.host,
port=args.port,
reload=args.reload,
)
return 0
def _cmd_evidence(args: argparse.Namespace) -> int:
output = write_runway_evidence(
ledger_path=_ledger_path(args),
@ -227,6 +240,12 @@ def build_parser() -> argparse.ArgumentParser:
)
evidence.set_defaults(func=_cmd_evidence)
serve = sub.add_parser("serve", help="Run the HTTP read API")
serve.add_argument("--host", default="127.0.0.1")
serve.add_argument("--port", type=int, default=8080)
serve.add_argument("--reload", action="store_true")
serve.set_defaults(func=_cmd_serve)
return parser