Browse Source

some change in README.md

mahdi
mahdihty 4 years ago
parent
commit
120bf9c965
  1. 19
      README.md
  2. 2
      index.js

19
README.md

@ -1,4 +1,21 @@
## Use case
cd to main project directory
<br>
run: node index.js // output: [listening on *:3000]
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/)

2
index.js

@ -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');
});

Loading…
Cancel
Save