77ethers commited on
Commit
b4bf396
·
verified ·
1 Parent(s): 9c72b9a

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. gridops/server/app.py +10 -6
gridops/server/app.py CHANGED
@@ -104,15 +104,19 @@ def list_tasks():
104
  # ── Root redirect to dashboard ───────────────────────────────────────────
105
 
106
  @app.get("/")
107
- def root_redirect():
108
- """Redirect root to dashboard so HF Space iframe shows the UI."""
109
- return RedirectResponse(url="/dashboard/")
 
 
110
 
111
 
112
  @app.get("/web")
113
- def web_redirect():
114
- """Redirect /web to dashboard (OpenEnv default web UI path)."""
115
- return RedirectResponse(url="/dashboard/")
 
 
116
 
117
 
118
  # ── Serve dashboard static files ────────────────────────────────────────
 
104
  # ── Root redirect to dashboard ───────────────────────────────────────────
105
 
106
  @app.get("/")
107
+ def root_serve():
108
+ """Serve dashboard directly at root so HF Space iframe shows the UI."""
109
+ from fastapi.responses import HTMLResponse
110
+ index = Path(__file__).parent / "static" / "index.html"
111
+ return HTMLResponse(content=index.read_text(), status_code=200)
112
 
113
 
114
  @app.get("/web")
115
+ def web_serve():
116
+ """Serve dashboard at /web (OpenEnv default web UI path)."""
117
+ from fastapi.responses import HTMLResponse
118
+ index = Path(__file__).parent / "static" / "index.html"
119
+ return HTMLResponse(content=index.read_text(), status_code=200)
120
 
121
 
122
  # ── Serve dashboard static files ────────────────────────────────────────