From 120bf9c965cd845d53e689a8603a7f9cdc0127f6 Mon Sep 17 00:00:00 2001 From: mahdihty Date: Sun, 14 Mar 2021 13:15:53 +0330 Subject: [PATCH] some change in README.md --- README.md | 19 ++++++++++++++++++- index.js | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0e58d39..5f32a4d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,21 @@ ## Use case cd to main project directory
-run: node index.js // output: [listening on *:3000] \ No newline at end of file +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/) + + + diff --git a/index.js b/index.js index 60746a8..6c77464 100644 --- a/index.js +++ b/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'); });