Add minimal WebSocket quiz server

This commit is contained in:
2026-10-23 13:24:49 +00:00
parent b2c00cd23d
commit e14262db4d
+15
View File
@@ -0,0 +1,15 @@
const WebSocket = require('ws');
const PORT = process.env.PORT || 8080;
const wss = new WebSocket.Server({ port: PORT });
const question = {
question: 'What is the capital of France?',
answer: 'Paris'
};
wss.on('connection', (ws) => {
ws.send(JSON.stringify(question));
});
console.log(`SeatBack Trivia WebSocket server listening on port ${PORT}`);