feat(web): add WebSocket chat handler with message persistence

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-07 02:36:42 +08:00
parent 19a1a4e6d2
commit 375540f528
2 changed files with 63 additions and 7 deletions

View File

@@ -8,6 +8,7 @@ import { promptsRouter } from './routes/prompts';
import { pipelineRouter } from './routes/pipeline';
import { assetsRouter } from './routes/assets';
import { configsRouter } from './routes/configs';
import { handleChat } from './ws/chat';
const app = express();
const server = createServer(app);
@@ -22,13 +23,7 @@ app.use('/api/pipeline', pipelineRouter);
app.use('/api/assets', assetsRouter);
app.use('/api/configs', configsRouter);
wss.on('connection', (ws) => {
// Placeholder - will be replaced in Task 3.1
console.log('WebSocket client connected');
ws.on('message', (data) => {
console.log('received:', data.toString());
});
});
wss.on('connection', handleChat);
const PORT = 3001;
initDb();