diff --git a/src/genesis/server/app.py b/src/genesis/server/app.py index bb1bd28..fa20142 100644 --- a/src/genesis/server/app.py +++ b/src/genesis/server/app.py @@ -119,6 +119,13 @@ def create_app( raise _error(404, "NOT_FOUND", "chat_state.js 不存在") return FileResponse(p, media_type="application/javascript") + @app.get("/chat_ws.js") + def chat_ws_js(): + p = static_dir / "chat_ws.js" + if not p.exists(): + raise _error(404, "NOT_FOUND", "chat_ws.js 不存在") + return FileResponse(p, media_type="application/javascript") + # ---------- 项目配置 ---------- @app.post("/api/projects") diff --git a/src/genesis/server/static/chat.html b/src/genesis/server/static/chat.html index f271d2f..3f8166f 100644 --- a/src/genesis/server/static/chat.html +++ b/src/genesis/server/static/chat.html @@ -454,8 +454,10 @@ +