Spaces:
Sleeping
Sleeping
ui: redirect root directly to /demo
Browse files- server/app.py +2 -16
server/app.py
CHANGED
|
@@ -13,6 +13,7 @@ import gradio as gr
|
|
| 13 |
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
|
| 14 |
from fastapi.responses import HTMLResponse
|
| 15 |
from fastapi.responses import JSONResponse
|
|
|
|
| 16 |
from pydantic import BaseModel
|
| 17 |
|
| 18 |
from .models import ESCTRAction, ESCTRObservation, ESCTRState
|
|
@@ -156,22 +157,7 @@ def create_app() -> FastAPI:
|
|
| 156 |
|
| 157 |
@app.get("/", response_class=HTMLResponse)
|
| 158 |
def root():
|
| 159 |
-
return ""
|
| 160 |
-
<html>
|
| 161 |
-
<head><title>ESCTR Environment</title></head>
|
| 162 |
-
<body style="font-family: sans-serif; max-width: 880px; margin: 32px auto;">
|
| 163 |
-
<h1>ESCTR Environment</h1>
|
| 164 |
-
<p>OpenEnv-compatible financial auditing environment.</p>
|
| 165 |
-
<ul>
|
| 166 |
-
<li><a href="/demo" target="_blank">Interactive Demo (Gradio)</a></li>
|
| 167 |
-
<li><a href="/health" target="_blank">/health</a></li>
|
| 168 |
-
<li><a href="/schema" target="_blank">/schema</a></li>
|
| 169 |
-
<li><a href="/metadata" target="_blank">/metadata</a></li>
|
| 170 |
-
<li><a href="/trace" target="_blank">/trace</a></li>
|
| 171 |
-
</ul>
|
| 172 |
-
</body>
|
| 173 |
-
</html>
|
| 174 |
-
"""
|
| 175 |
|
| 176 |
@app.websocket("/ws")
|
| 177 |
async def websocket_endpoint(websocket: WebSocket):
|
|
|
|
| 13 |
from fastapi import FastAPI, WebSocket, WebSocketDisconnect
|
| 14 |
from fastapi.responses import HTMLResponse
|
| 15 |
from fastapi.responses import JSONResponse
|
| 16 |
+
from fastapi.responses import RedirectResponse
|
| 17 |
from pydantic import BaseModel
|
| 18 |
|
| 19 |
from .models import ESCTRAction, ESCTRObservation, ESCTRState
|
|
|
|
| 157 |
|
| 158 |
@app.get("/", response_class=HTMLResponse)
|
| 159 |
def root():
|
| 160 |
+
return RedirectResponse(url="/demo")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
|
| 162 |
@app.websocket("/ws")
|
| 163 |
async def websocket_endpoint(websocket: WebSocket):
|