stackchain-dashboard/src/views.py
timmy f0dc260c9b
All checks were successful
CI / lint (pull_request) Successful in 10s
CI / build-frontend (pull_request) Successful in 5s
fix: serve dashboard independently of process cwd (#46)
2026-08-05 22:17:33 +00:00

13 lines
321 B
Python

from pathlib import Path
from fastapi import APIRouter
from fastapi.responses import HTMLResponse
router = APIRouter()
DASHBOARD_FILE = Path(__file__).resolve().parent.parent / "frontend" / "index.html"
@router.get("/", response_class=HTMLResponse)
async def dashboard() -> str:
return DASHBOARD_FILE.read_text()