printf-sourav commited on
Commit
3a2d933
·
1 Parent(s): bb5e238

readme fixed

Browse files
Files changed (2) hide show
  1. api/main.py +5 -2
  2. frontend/app.js +1 -1
api/main.py CHANGED
@@ -16,7 +16,7 @@ from typing import Dict, List, Optional
16
 
17
  from fastapi import FastAPI, HTTPException, Query
18
  from fastapi.middleware.cors import CORSMiddleware
19
- from fastapi.responses import JSONResponse
20
  from fastapi.staticfiles import StaticFiles
21
  from pydantic import BaseModel
22
 
@@ -120,7 +120,10 @@ def _openenv_get_session(session_id: str) -> DevOpsEnv | None:
120
  # --- Endpoints ---
121
  @app.get("/")
122
  async def root():
123
- """Health check endpoint."""
 
 
 
124
  return {
125
  "service": "DevOps RL Agent API",
126
  "status": "running",
 
16
 
17
  from fastapi import FastAPI, HTTPException, Query
18
  from fastapi.middleware.cors import CORSMiddleware
19
+ from fastapi.responses import FileResponse, JSONResponse
20
  from fastapi.staticfiles import StaticFiles
21
  from pydantic import BaseModel
22
 
 
120
  # --- Endpoints ---
121
  @app.get("/")
122
  async def root():
123
+ """Serve the dashboard as the Space landing page."""
124
+ index_path = FRONTEND_DIR / "index.html"
125
+ if index_path.exists():
126
+ return FileResponse(index_path)
127
  return {
128
  "service": "DevOps RL Agent API",
129
  "status": "running",
frontend/app.js CHANGED
@@ -1,4 +1,4 @@
1
- const API_URL = 'http://127.0.0.1:8000';
2
 
3
  // Global state
4
  let currentEpisodes = [];
 
1
+ const API_URL = window.location.origin;
2
 
3
  // Global state
4
  let currentEpisodes = [];