Spaces:
Paused
Paused
Download src/content_engine/api/routes_ui.py from dippoo/content-engine: direct link, hf CLI and curl.
- Browser
- Download file 609 Bytes
-
https://huggingface.co/spaces/dippoo/content-engine/resolve/main/src/content_engine/api/routes_ui.py
- Command line
-
hf download hf://spaces/dippoo/content-engine/src/content_engine/api/routes_ui.py
-
curl -L -o routes_ui.py https://huggingface.co/spaces/dippoo/content-engine/resolve/main/src/content_engine/api/routes_ui.py
609 Bytes
| """Web UI route — serves the single-page dashboard.""" | |
| from __future__ import annotations | |
| from pathlib import Path | |
| from fastapi import APIRouter | |
| from fastapi.responses import HTMLResponse, Response | |
| router = APIRouter(tags=["ui"]) | |
| UI_HTML_PATH = Path(__file__).parent / "ui.html" | |
| async def dashboard(): | |
| """Serve the main dashboard UI.""" | |
| content = UI_HTML_PATH.read_text(encoding="utf-8") | |
| return Response( | |
| content=content, | |
| media_type="text/html", | |
| headers={"Cache-Control": "no-cache, no-store, must-revalidate"}, | |
| ) | |