var cronjob = require('cron').CronJob;
var shelljs = require('shelljs/global');
var sticky = require('sticky-session');
-var redis = require('socket.io-redis');
var express = require('express');
var config = require('./config/environment');
var app = express();
var server = http.createServer(app);
-var io = sio(server, {
- serveClient: (config.env === 'production') ? false : true,
- path: '/socket.io-client'
-});
-
-io.adapter(redis({
- host: config.ip,
- port: 6379
-}));
-
-require('./config/socketio')(io, require('./services/dashboard')(io));
-
if (!sticky.listen(server, config.port)) {
console.log('master');
// Slave code
require('./config/express')(app);
require('./routes')(app);
+
+ var io = sio(server, {
+ serveClient: (config.env === 'production') ? false : true,
+ path: '/socket.io-client'
+ });
+
+ io.adapter(sio_redis({
+ host: config.ip,
+ port: 6379
+ }));
+
+ require('./config/socketio')(io, require('./services/dashboard')(io));
}
// Expose app