28 lines
1.1 KiB
Python
28 lines
1.1 KiB
Python
"""SSR frontend service: server-rendered content pages only (content.py). All
|
|
climate data comes from the backend's content API over HTTP (api_client.py) --
|
|
this process holds no data of its own and does no polars/DB work.
|
|
|
|
No static-asset mount here (repo-split Stage 4): every real topology routes
|
|
JS/CSS/images to backend's own StaticFiles mount -- prod/beta's Caddy never
|
|
sends those paths here, and backend's own dev/bare-metal reverse-proxy fallback
|
|
(THERMOGRAPH_FRONTEND_BASE_INTERNAL) only forwards the specific content paths
|
|
content.register() claims. A static mount here would just be unreachable dead
|
|
code in every deployment.
|
|
"""
|
|
from fastapi import FastAPI
|
|
|
|
import content
|
|
|
|
app = FastAPI(title="Thermograph SSR", version="0.1.0")
|
|
|
|
|
|
@app.get("/healthz")
|
|
def healthz():
|
|
"""Liveness probe: the process is up and serving. Deliberately does no I/O
|
|
-- no call to the backend -- so it stays cheap and reliable for a tight
|
|
healthcheck interval. Readiness (backend reachable) is a separate concern."""
|
|
return {"status": "ok"}
|
|
|
|
|
|
# NOTE: "/" is not here -- the homepage is server-rendered by content.register().
|
|
content.register(app)
|