from __future__ import annotations import os from pathlib import Path from fastapi import FastAPI from fastapi.responses import FileResponse, HTMLResponse, RedirectResponse from fastapi.staticfiles import StaticFiles SITE_ROOT = Path(os.environ.get("SITE_ROOT", "/data")).resolve() REPORT = SITE_ROOT / "analysis" / "report.html" app = FastAPI(title="Birch HTML Benchmark") @app.get("/") def root(): if REPORT.exists(): return RedirectResponse("/analysis/report.html", status_code=302) return HTMLResponse( "
Report not found at {REPORT}. "
"Check that the bucket is mounted at /data.