Add Jenkins CI pipeline and WebSocket test #8
@@ -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}`);
|
||||||
Reference in New Issue
Block a user