soumi guria commited on
Commit
3db147c
Β·
1 Parent(s): 1b81250

updated home route

Browse files
Files changed (1) hide show
  1. backend/main.py +14 -0
backend/main.py CHANGED
@@ -251,6 +251,20 @@ class StepResponse(BaseModel):
251
 
252
 
253
  # ── Routes ──────────────────────────────────────────────────────────────────
 
 
 
 
 
 
 
 
 
 
 
 
 
 
254
 
255
  @app.post("/reset", response_model=ResetResponse)
256
  def reset_env(req: Optional[ResetRequest] = None):
 
251
 
252
 
253
  # ── Routes ──────────────────────────────────────────────────────────────────
254
+ # Add the home route with details of all the other routes
255
+ @app.get("/")
256
+ def read_root():
257
+ return {"message": "Cognitive Load Manager is running πŸš€"}
258
+ routes = []
259
+ for route in app.routes:
260
+ route_info = {"path": route.path, "name": getattr(route, "name", "")}
261
+ if hasattr(route, "methods"):
262
+ route_info["methods"] = list(route.methods)
263
+ routes.append(route_info)
264
+ return {
265
+ "message": "Cognitive Load Manager is running πŸš€",
266
+ "routes": routes
267
+ }
268
 
269
  @app.post("/reset", response_model=ResetResponse)
270
  def reset_env(req: Optional[ResetRequest] = None):