Graheet commited on
Commit
40128b8
·
1 Parent(s): 983b0f6

Redirect root to FastAPI docs

Browse files
server/__pycache__/app.cpython-313.pyc CHANGED
Binary files a/server/__pycache__/app.cpython-313.pyc and b/server/__pycache__/app.cpython-313.pyc differ
 
server/app.py CHANGED
@@ -14,7 +14,7 @@ from threading import RLock
14
  from typing import Any, Dict, Optional
15
 
16
  from fastapi import FastAPI, HTTPException, Request
17
- from fastapi.responses import JSONResponse
18
  from pydantic import BaseModel, Field
19
  import uvicorn
20
 
@@ -58,20 +58,11 @@ async def unhandled_exception_handler(
58
  )
59
 
60
 
61
- @app.get("/")
62
- def root() -> Dict[str, Any]:
63
- """Return a lightweight root payload for browser and Space checks."""
64
-
65
- return {
66
- "name": "dataops-env",
67
- "status": "ok",
68
- "endpoints": {
69
- "health": "/health",
70
- "reset": "POST /reset",
71
- "step": "POST /step",
72
- "state": "GET /state",
73
- },
74
- }
75
 
76
 
77
  @app.get("/health")
 
14
  from typing import Any, Dict, Optional
15
 
16
  from fastapi import FastAPI, HTTPException, Request
17
+ from fastapi.responses import JSONResponse, RedirectResponse
18
  from pydantic import BaseModel, Field
19
  import uvicorn
20
 
 
58
  )
59
 
60
 
61
+ @app.get("/", include_in_schema=False)
62
+ def root() -> RedirectResponse:
63
+ """Redirect the Space landing page to FastAPI docs."""
64
+
65
+ return RedirectResponse(url="/docs")
 
 
 
 
 
 
 
 
 
66
 
67
 
68
  @app.get("/health")