blob: f8b5ca722298e0d02baa6aab87ceb5416914617e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
const express = require('express');
const app = express();
const http = require('http').Server(app);
const path = require('path');
const io = require('socket.io')(http);
app.use(express.static(path.join(__dirname, '../../build')));
io.on('connection', (socket) => {
socket.on('update-remote-board', (board) => {
io.emit('update-client-board', board)
})
});
// Start the server
const PORT = process.env.PORT || 5000;
http.listen(PORT, () => {
console.log(`App listening on port ${PORT}`);
});
|