fix: Move static files mount to end of file to not override API routes

This commit is contained in:
OpenClaw Bot
2026-02-19 12:11:09 +08:00
parent 1fa94e0ca4
commit 8404e83a1c

View File

@@ -983,8 +983,8 @@ async def get_entity_mentions(entity_id: str):
async def health_check(): async def health_check():
return { return {
"status": "ok", "status": "ok",
"version": "0.4.0", "version": "0.5.0",
"phase": "Phase 4 - Agent Assistant", "phase": "Phase 5 - Timeline View",
"oss_available": OSS_AVAILABLE, "oss_available": OSS_AVAILABLE,
"tingwu_available": TINGWU_AVAILABLE, "tingwu_available": TINGWU_AVAILABLE,
"db_available": DB_AVAILABLE, "db_available": DB_AVAILABLE,
@@ -993,13 +993,6 @@ async def health_check():
"llm_client_available": LLM_CLIENT_AVAILABLE "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 ==================== # ==================== Phase 4: Agent 助手 API ====================
@@ -1341,3 +1334,11 @@ async def get_entity_timeline(entity_id: str):
"events": timeline, "events": timeline,
"total_count": len(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)