Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -141,6 +141,14 @@ async def view_details(image_id: str):
|
|
| 141 |
if image_id not in OCR_RESULTS:
|
| 142 |
raise HTTPException(status_code=404, detail="No OCR result found for this ID")
|
| 143 |
return OCR_RESULTS[image_id]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 144 |
|
| 145 |
|
| 146 |
# --------------------------------------------------
|
|
|
|
| 141 |
if image_id not in OCR_RESULTS:
|
| 142 |
raise HTTPException(status_code=404, detail="No OCR result found for this ID")
|
| 143 |
return OCR_RESULTS[image_id]
|
| 144 |
+
@app.get("/debug/db")
|
| 145 |
+
async def debug_db():
|
| 146 |
+
return {"db_name": _db.name, "collections": await _db.list_collection_names()}
|
| 147 |
+
|
| 148 |
+
@app.get("/debug/test-write")
|
| 149 |
+
async def test_write():
|
| 150 |
+
res = await _db["debug_test"].insert_one({"ping": "ok"})
|
| 151 |
+
return {"inserted_id": str(res.inserted_id)}
|
| 152 |
|
| 153 |
|
| 154 |
# --------------------------------------------------
|