diff --git a/index.js b/index.js index 23a6872..4240aef 100644 --- a/index.js +++ b/index.js @@ -60,8 +60,8 @@ io.on('connection', async (socket) => { app.post('/emit/:room', function (req, res) { // console.log(req.body); console.log('room is :','room-' + req.params.room); - console.log('message',req.body.data.title); - io.to('room-' + req.params.room).emit('room-event', req.body.data.title); + console.log('message',req.body.data); + io.to('room-' + req.params.room).emit('room-event', req.body.data); // console.log(req.body.data); // res.json(req.body.data) res.send('done');