I am using node.js
for backend and angular
for frontend...
I thought to use socket.io
but I am not sure how how to handle comunication between users...
For example how can I push message message to specific user after message is saved to database?
ex.
router.post('/message', function(req, res) {
Message.create({
text: req.body.text,
fromUser: req.fromToken.id,
toUser: req.body.toUser
}, function(err,message) {
//FROM HERE WHAT IS THE BEST WAY TO PUSH MESSAGE TO USER
})
});