Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by Mauro Bonucci on 28/06/2017.
- */
- var app = require('express')();
- var http = require('http').Server(app);
- var io = require('socket.io')(http);
- var Redis = require('ioredis');
- var redis = new Redis();
- redis.on('message', function (channel, message) {
- //console.log('Message Recieved: ' + message);
- message = JSON.parse(message);
- io.emit(channel + ':' + message.event, message.data);
- });
- http.listen(2020, function () {
- console.log('Listening on Port 2020');
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement