mirror of
https://github.com/zvx-echo6/central.git
synced 2026-06-11 12:24:37 +02:00
feat(gui): add FastAPI + Jinja2 + HTMX scaffold
- FastAPI app with Jinja2 templates and Pico CSS + HTMX from CDN - Routes: GET / (placeholder page), GET /health (JSON healthcheck) - systemd unit (no Install section - manual start only) - TestClient tests for both endpoints Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
69ef8b3e93
commit
614312db36
9 changed files with 437 additions and 0 deletions
23
src/central/gui/routes.py
Normal file
23
src/central/gui/routes.py
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"""Route handlers for Central GUI."""
|
||||
|
||||
from fastapi import APIRouter, Request
|
||||
from fastapi.responses import HTMLResponse
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
||||
@router.get("/health")
|
||||
async def health() -> dict:
|
||||
"""Health check endpoint."""
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
@router.get("/", response_class=HTMLResponse)
|
||||
async def index(request: Request) -> HTMLResponse:
|
||||
"""Render the index page."""
|
||||
from central.gui import templates
|
||||
|
||||
return templates.TemplateResponse(
|
||||
request=request,
|
||||
name="index.html",
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue