text: // Generated by CoffeeScript 1.8.0
  (function() {
    var io, server, userHelper;
  
    server = require("../app").server;
  
    io = require('socket.io')(server);
  
    userHelper = require("../Helper/userHelper");
  
    exports.index = function(req, res) {
      if (userHelper.isLogin(req, res)) {
        return res.render("index_login", {
          isLogin: userHelper.isLogin(req, res)
        });
      } else {
        return res.render("index");
      }
    };
  
    io.on('connection', function(socket) {
      console.log('a user connected');
      socket.on('disconnect', function() {
        return console.log('user disconnected');
      });
      return socket.on('chat message', function(msg) {
        return io.emit('chat message success', msg);
      });
    });
  
  }).call(this);
  
  //# sourceMappingURL=home.js.map
  