mercredi 28 octobre 2015

NodeJS require error when running the server.js

I am having an error when running nodejs server.js view image

I dont know why the require is an error ? I am using Laravel 5, I'm learning laravel with websocket.. please help me with this :( below is my node server.js code

var app = require('express')();
var server = require('http').Server(app);
var io = require('socket.io')(server);
var redis = require('redis');

server.listen(8890);
io.on('connection', function (socket) {

  console.log("new client connected");
  var redisClient = redis.createClient();
  redisClient.subscribe('message');

  redisClient.on("message", function(channel, message) {
    console.log("mew message in queue "+ message + "channel");
    socket.emit(channel, message);
  });

  socket.on('disconnect', function() {
    redisClient.quit();
  });

});



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1HcUfCD
via IFTTT

Aucun commentaire:

Enregistrer un commentaire