Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/MessageInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
Expand Down
31 changes: 19 additions & 12 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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('╚════════════════════════════════════════════════════════════╝');
Expand Down