From 8404e83a1c14113db98ba3207bcafe3272310071 Mon Sep 17 00:00:00 2001 From: OpenClaw Bot Date: Thu, 19 Feb 2026 12:11:09 +0800 Subject: [PATCH] fix: Move static files mount to end of file to not override API routes --- backend/main.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/backend/main.py b/backend/main.py index e1a01aa..18ad1ca 100644 --- a/backend/main.py +++ b/backend/main.py @@ -983,8 +983,8 @@ async def get_entity_mentions(entity_id: str): async def health_check(): return { "status": "ok", - "version": "0.4.0", - "phase": "Phase 4 - Agent Assistant", + "version": "0.5.0", + "phase": "Phase 5 - Timeline View", "oss_available": OSS_AVAILABLE, "tingwu_available": TINGWU_AVAILABLE, "db_available": DB_AVAILABLE, @@ -993,13 +993,6 @@ async def health_check(): "llm_client_available": LLM_CLIENT_AVAILABLE } -# Serve frontend -app.mount("/", StaticFiles(directory="frontend", html=True), name="frontend") - -if __name__ == "__main__": - import uvicorn - uvicorn.run(app, host="0.0.0.0", port=8000) - # ==================== Phase 4: Agent 助手 API ==================== @@ -1341,3 +1334,11 @@ async def get_entity_timeline(entity_id: str): "events": timeline, "total_count": len(timeline) } + + +# Serve frontend - MUST be last to not override API routes +app.mount("/", StaticFiles(directory="frontend", html=True), name="frontend") + +if __name__ == "__main__": + import uvicorn + uvicorn.run(app, host="0.0.0.0", port=8000)