show users logged in count with node js code example
Example: nodejs api to logged in users count on an application
var io = require('socket.io').listen(8080);
var count = 0
io.sockets.on('connection', function(socket) {
count++;
io.sockets.emit('message', { count: count });
socket.on('disconnect', function(){
count--;
io.sockets.emit('message', { count: count });
})
});