Commit ·
f22517f
1
Parent(s): b870822
Final Commit
Browse files
server.py
CHANGED
|
@@ -468,25 +468,15 @@ def _demo_html() -> str:
|
|
| 468 |
# Routes
|
| 469 |
# ---------------------------------------------------------------------------
|
| 470 |
|
| 471 |
-
@app.get("/")
|
| 472 |
-
def root() ->
|
| 473 |
"""
|
| 474 |
-
|
| 475 |
|
| 476 |
-
|
| 477 |
-
|
| 478 |
"""
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
results = run_all_tasks()
|
| 482 |
-
payload = {
|
| 483 |
-
"status": "ok",
|
| 484 |
-
"env": "ACRE",
|
| 485 |
-
"version": "1.0.0",
|
| 486 |
-
"message": "ACRE running successfully",
|
| 487 |
-
"results": results,
|
| 488 |
-
}
|
| 489 |
-
return JSONResponse(content=payload)
|
| 490 |
|
| 491 |
|
| 492 |
@app.get("/health", response_model=CompatibilityHealthResponse)
|
|
@@ -505,7 +495,7 @@ def demo() -> JSONResponse:
|
|
| 505 |
|
| 506 |
@app.get("/ui", response_class=HTMLResponse)
|
| 507 |
def demo_ui() -> HTMLResponse:
|
| 508 |
-
"""
|
| 509 |
return HTMLResponse(content=_demo_html())
|
| 510 |
|
| 511 |
|
|
|
|
| 468 |
# Routes
|
| 469 |
# ---------------------------------------------------------------------------
|
| 470 |
|
| 471 |
+
@app.get("/", response_class=HTMLResponse)
|
| 472 |
+
def root() -> HTMLResponse:
|
| 473 |
"""
|
| 474 |
+
Hugging Face Space homepage.
|
| 475 |
|
| 476 |
+
Serve the interactive UI so opening the Space shows a real demo page.
|
| 477 |
+
The live JSON execution results remain available at `GET /demo`.
|
| 478 |
"""
|
| 479 |
+
return HTMLResponse(content=_demo_html())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 480 |
|
| 481 |
|
| 482 |
@app.get("/health", response_model=CompatibilityHealthResponse)
|
|
|
|
| 495 |
|
| 496 |
@app.get("/ui", response_class=HTMLResponse)
|
| 497 |
def demo_ui() -> HTMLResponse:
|
| 498 |
+
"""Alias for the interactive UI (same as `/`)."""
|
| 499 |
return HTMLResponse(content=_demo_html())
|
| 500 |
|
| 501 |
|