@ -2,3 +2,20 @@
cd to main project directory
<br>
run: node index.js // output: [listening on *:3000]
### use pm2
#### install
sudo npm install pm2@latest -g
#### start
pm2 start index.js
#### monitor
pm2 monit
#### document
[pm2 quick start](https://pm2.keymetrics.io/docs/usage/quick-start/)
@ -52,7 +52,7 @@ io.on('connection', async (socket) => {
// });
app.post('/emit/:room', function (req, res) {
console.log(req.body);
// console.log(req.body);
io.to('room-' + req.params.room).emit('room-event', req.body.data.title);
res.send('done');
});