Spaces:
Running
Running
Add debug endpoint to inspect actual file contents on server
Browse files
app.py
CHANGED
@@ -508,6 +508,38 @@ async def serve_map():
|
|
508 |
raise
|
509 |
|
510 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
511 |
@app.get("/api/trees", response_model=list[Tree], tags=["Trees"])
|
512 |
async def get_trees(
|
513 |
limit: int = 100,
|
|
|
508 |
raise
|
509 |
|
510 |
|
511 |
+
@app.get("/debug/file-content", tags=["Debug"])
|
512 |
+
async def debug_file_content():
|
513 |
+
"""Debug endpoint to show actual file contents"""
|
514 |
+
try:
|
515 |
+
with open("static/map.html", encoding="utf-8") as f:
|
516 |
+
content = f.read()
|
517 |
+
|
518 |
+
# Extract key indicators
|
519 |
+
has_fire_emoji = "🔥" in content
|
520 |
+
has_v4 = "V4.0" in content
|
521 |
+
has_blue_theme = "#3b82f6" in content
|
522 |
+
has_red_border = "#ff0000" in content
|
523 |
+
|
524 |
+
return {
|
525 |
+
"file_exists": True,
|
526 |
+
"content_length": len(content),
|
527 |
+
"indicators": {
|
528 |
+
"has_fire_emoji": has_fire_emoji,
|
529 |
+
"has_v4_version": has_v4,
|
530 |
+
"has_blue_theme": has_blue_theme,
|
531 |
+
"has_red_debug_border": has_red_border
|
532 |
+
},
|
533 |
+
"first_200_chars": content[:200],
|
534 |
+
"title_line": next((line.strip() for line in content.split('\n') if '<title>' in line), "not found")
|
535 |
+
}
|
536 |
+
except Exception as e:
|
537 |
+
return {
|
538 |
+
"file_exists": False,
|
539 |
+
"error": str(e)
|
540 |
+
}
|
541 |
+
|
542 |
+
|
543 |
@app.get("/api/trees", response_model=list[Tree], tags=["Trees"])
|
544 |
async def get_trees(
|
545 |
limit: int = 100,
|