Minor webapp update

This commit is contained in:
Pawel Sarkowicz
2026-07-31 11:08:37 -04:00
parent 69a0d51f3c
commit 2a836b1ef6
3 changed files with 33 additions and 11 deletions
+8 -2
View File
@@ -23,7 +23,7 @@ from typing import Any
import numpy as np
import pandas as pd
from fastapi import FastAPI, HTTPException
from fastapi.responses import HTMLResponse
from fastapi.responses import HTMLResponse, PlainTextResponse
from fastapi.staticfiles import StaticFiles
from sklearn.decomposition import PCA
@@ -223,7 +223,7 @@ def _json_safe(o: Any) -> Any:
return o
@app.get("/")
@app.api_route("/", methods=["GET", "HEAD"])
def index():
html = (STATIC_DIR / "index.html").read_text(encoding="utf-8")
css_v = _file_version(STATIC_DIR / "app.css")
@@ -233,6 +233,12 @@ def index():
return HTMLResponse(content=html)
@app.get("/robots.txt", response_class=PlainTextResponse)
def robots():
# Disallow crawling — this is an interactive demo, not a site to index.
return "User-agent: *\nDisallow: /\n"
@app.get("/api/health")
def health():
s = app.state