Add update-available banner + versioned /health endpoint

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
jtricerolph 2026-08-06 14:11:32 +00:00
parent fe095d0891
commit a3872798ca
4 changed files with 97 additions and 1 deletions

View file

@ -1,4 +1,6 @@
import logging
import os
import time
from contextlib import asynccontextmanager
from fastapi import FastAPI
@ -161,6 +163,7 @@ app = FastAPI(
version="1.0.0",
lifespan=lifespan,
)
STARTED_AT = str(int(time.time() * 1000))
# No CORS middleware — same-origin via nginx (A1)
@ -199,4 +202,4 @@ app.include_router(internal_router)
@app.get("/health")
async def health_check():
return {"status": "healthy"}
return {"status": "healthy", "version": os.environ.get("BUILD_VERSION", STARTED_AT)}