Spaces:
Sleeping
Sleeping
Commit
·
e3f5da2
1
Parent(s):
9473940
API: add /api/health (public) and /api/ping (auth) for diagnostics
Browse files
app.py
CHANGED
|
@@ -266,6 +266,16 @@ def list_attributes(_: None = Depends(_require_auth)):
|
|
| 266 |
return JSONResponse(items)
|
| 267 |
|
| 268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 269 |
@api.post("/api/edit")
|
| 270 |
async def api_edit(
|
| 271 |
file: UploadFile = File(...),
|
|
|
|
| 266 |
return JSONResponse(items)
|
| 267 |
|
| 268 |
|
| 269 |
+
@api.get("/api/health")
|
| 270 |
+
def health():
|
| 271 |
+
return {"status": "ok"}
|
| 272 |
+
|
| 273 |
+
|
| 274 |
+
@api.get("/api/ping")
|
| 275 |
+
def ping(_: None = Depends(_require_auth)):
|
| 276 |
+
return {"status": "ok", "auth": True}
|
| 277 |
+
|
| 278 |
+
|
| 279 |
@api.post("/api/edit")
|
| 280 |
async def api_edit(
|
| 281 |
file: UploadFile = File(...),
|