Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse files- server/app.py +11 -0
server/app.py
CHANGED
|
@@ -3,6 +3,7 @@ from __future__ import annotations
|
|
| 3 |
from typing import Any
|
| 4 |
|
| 5 |
from fastapi import Body, FastAPI, HTTPException
|
|
|
|
| 6 |
from pydantic import BaseModel, ValidationError
|
| 7 |
|
| 8 |
from env.environment import FlakySleuthEnv
|
|
@@ -72,6 +73,16 @@ def health() -> dict[str, str]:
|
|
| 72 |
return {"status": "healthy"}
|
| 73 |
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
@app.get("/metadata")
|
| 76 |
def metadata() -> dict[str, str]:
|
| 77 |
return {
|
|
|
|
| 3 |
from typing import Any
|
| 4 |
|
| 5 |
from fastapi import Body, FastAPI, HTTPException
|
| 6 |
+
from fastapi.responses import RedirectResponse
|
| 7 |
from pydantic import BaseModel, ValidationError
|
| 8 |
|
| 9 |
from env.environment import FlakySleuthEnv
|
|
|
|
| 73 |
return {"status": "healthy"}
|
| 74 |
|
| 75 |
|
| 76 |
+
@app.get("/", include_in_schema=False)
|
| 77 |
+
def root() -> RedirectResponse:
|
| 78 |
+
return RedirectResponse(url="/docs", status_code=307)
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
@app.get("/web", include_in_schema=False)
|
| 82 |
+
def web() -> RedirectResponse:
|
| 83 |
+
return RedirectResponse(url="/docs", status_code=307)
|
| 84 |
+
|
| 85 |
+
|
| 86 |
@app.get("/metadata")
|
| 87 |
def metadata() -> dict[str, str]:
|
| 88 |
return {
|