Spaces:
Sleeping
Sleeping
Add health check endpoint
Browse files
app.py
CHANGED
|
@@ -30,6 +30,10 @@ def update_job_status(job_id: str, state: str, detail: str = "", result: str = "
|
|
| 30 |
"result": result
|
| 31 |
}
|
| 32 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
@app.post("/upload/")
|
| 34 |
async def upload_image(background_tasks: BackgroundTasks, file: UploadFile = File(...)):
|
| 35 |
# Basic validation
|
|
|
|
| 30 |
"result": result
|
| 31 |
}
|
| 32 |
|
| 33 |
+
@app.get("/health")
|
| 34 |
+
def health_check():
|
| 35 |
+
return {"status": "ok"}
|
| 36 |
+
|
| 37 |
@app.post("/upload/")
|
| 38 |
async def upload_image(background_tasks: BackgroundTasks, file: UploadFile = File(...)):
|
| 39 |
# Basic validation
|