Spaces:
Sleeping
Sleeping
anoderb commited on
Commit ·
2f51199
1
Parent(s): 180be98
debug: add /debug/static endpoint to list files in /app/static
Browse files- backend/app/main.py +9 -0
backend/app/main.py
CHANGED
|
@@ -51,6 +51,15 @@ async def shutdown_event():
|
|
| 51 |
async def get_status():
|
| 52 |
return scraper_scheduler.get_status()
|
| 53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
@app.get("/logs")
|
| 55 |
async def get_logs(limit: int = Query(100, le=500), level: Optional[str] = None):
|
| 56 |
return memory_handler.get_logs(limit=limit, level=level)
|
|
|
|
| 51 |
async def get_status():
|
| 52 |
return scraper_scheduler.get_status()
|
| 53 |
|
| 54 |
+
@app.get("/debug/static")
|
| 55 |
+
def debug_static():
|
| 56 |
+
import os
|
| 57 |
+
files = []
|
| 58 |
+
for root, dirs, filenames in os.walk("/app/static"):
|
| 59 |
+
for f in filenames:
|
| 60 |
+
files.append(os.path.relpath(os.path.join(root, f), "/app/static"))
|
| 61 |
+
return {"files": sorted(files)}
|
| 62 |
+
|
| 63 |
@app.get("/logs")
|
| 64 |
async def get_logs(limit: int = Query(100, le=500), level: Optional[str] = None):
|
| 65 |
return memory_handler.get_logs(limit=limit, level=level)
|