I am having an error when running node 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();
});
});
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire