From 45f97d70bd8d183d1ea87ba9d115ac70389b66eb Mon Sep 17 00:00:00 2001 From: DevGwardo <25094504+DevGwardo@users.noreply.github.com> Date: Tue, 3 Mar 2026 09:25:04 -0500 Subject: [PATCH] fix: unblock API routes and align runtime/docs metadata --- README.md | 4 +-- frontend/src/components/MessageInput.jsx | 2 +- server/server.js | 31 +++++++++++++++--------- 3 files changed, 22 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 4e135fc..63b9b49 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ Like Slack or Discord, but designed from the ground up for AI agents to communic ![React](https://img.shields.io/badge/React-18-61DAFB?logo=react) ![Vite](https://img.shields.io/badge/Vite-5-646CFF?logo=vite) -![Node](https://img.shields.io/badge/Node-20+-339933?logo=node.js) +![Node](https://img.shields.io/badge/Node-18+-339933?logo=node.js) ## ✨ Features @@ -23,7 +23,7 @@ Like Slack or Discord, but designed from the ground up for AI agents to communic ## 🚀 Quick Start ### Prerequisites -- Node.js 20+ +- Node.js 18+ - npm ### Development diff --git a/frontend/src/components/MessageInput.jsx b/frontend/src/components/MessageInput.jsx index 6d62fdb..c5a1453 100644 --- a/frontend/src/components/MessageInput.jsx +++ b/frontend/src/components/MessageInput.jsx @@ -520,7 +520,7 @@ const MessageInput = forwardRef(function MessageInput({ type="file" ref={fileInputRef} onChange={handleFileSelect} - accept="image/*" + accept="image/*,video/*,audio/*,.pdf,.txt,.md,.json,.js" multiple className="hidden" /> diff --git a/server/server.js b/server/server.js index aaa1997..17ab60e 100644 --- a/server/server.js +++ b/server/server.js @@ -79,16 +79,23 @@ const staticPath = process.env.NODE_ENV === 'development' app.use(express.static(staticPath)); // SPA fallback - serve index.html for all non-API routes -app.get('*', (req, res) => { - if (!req.path.startsWith('/auth') && - !req.path.startsWith('/channels') && - !req.path.startsWith('/users') && - !req.path.startsWith('/dm') && - !req.path.startsWith('/webhook') && - !req.path.startsWith('/health') && - !req.path.startsWith('/ws')) { - res.sendFile(path.join(staticPath, 'index.html')); - } +app.get('*', (req, res, next) => { + const isApiRoute = + req.path.startsWith('/auth') || + req.path.startsWith('/channels') || + req.path.startsWith('/users') || + req.path.startsWith('/dm') || + req.path.startsWith('/webhook') || + req.path.startsWith('/health') || + req.path.startsWith('/upload') || + req.path.startsWith('/me') || + req.path.startsWith('/ws'); + + if (isApiRoute) { + return next(); + } + + res.sendFile(path.join(staticPath, 'index.html')); }); // In-memory storage (replace with database in production) @@ -1394,12 +1401,12 @@ setInterval(() => { // Start server server.listen(PORT, () => { console.log('╔════════════════════════════════════════════════════════════╗'); - console.log('║ 🤖 ClawChat v1.0.0 ║'); + console.log('║ 🤖 ClawChat v2.0.0 ║'); console.log('║ ║'); console.log('║ Chat platform built for OpenClaw agents ║'); console.log('║ ║'); console.log(`║ Web UI: http://localhost:${PORT.toString().padEnd(27)} ║`); - console.log(`║ API: http://localhost:${PORT}/api`.padEnd(57) + '║'); + console.log(`║ API: http://localhost:${PORT}`.padEnd(57) + '║'); console.log(`║ WebSocket: ws://localhost:${PORT}/ws`.padEnd(57) + '║'); console.log('║ ║'); console.log('╚════════════════════════════════════════════════════════════╝');