var express = require('express');
var app = express();
var server = require('http').createServer(app);  
var io = require('socket.io').listen(server);
//var models = require("./models");

var PORT = process.env.PORT || 3000;


//models.sequelize.sync().then(function () {

  io.on('connection', function(client) {
    console.log('Someone connected!');

    client.on('join', function(data) {
      if(data === 'This is your teacher speaking') {
        client.emit('greeting', 'Hiya, Teach!');
      } else{
        client.emit('greeting', 'Hello, student. Please wait for your instructor to open a new poll.');
      }
    });

    client.on('newPoll', function(data) {
      io.sockets.emit('openPoll', data);
    });

    client.on('disconnect', function(client) {
      console.log('Bye!\n');
    });
  });

  require('./config/routes.js')(app, express);

  server.listen(PORT, function (){
    console.log('listening on port', PORT);
  });

// };
var express = require('express');
var app = express();
var server = require('http').createServer(app);  
var io = require('socket.io').listen(server);
//var models = require("./models");

var PORT = process.env.PORT || 3000;


// app.get('/', function (req, res) {
//   res.sendFile(__dirname + '/socketTest.html');
// })

//models.sequelize.sync().then(function () {

  io.on('connection', function(client) {
    console.log('Someone connected!');

    client.on('join', function(data) {
      if(data === 'This is your teacher speaking') {
        client.emit('greeting', 'Hiya, Teach!');
      } else{
        client.emit('greeting', 'Hello, student. Please wait for your instructor to open a new poll.');
      }
      //client.emit('openPoll', 'hello, its me');
    });

    client.on('newPoll', function(data) {
      console.log('>>>>>>>>>',data);
      io.sockets.emit('openPoll', data);
    });

    client.on('disconnect', function(client) {
      console.log('Bye!\n');
    });
  });

  require('./config/routes.js')(app, express);

  server.listen(PORT, function (){
    console.log('listening on port', PORT);
  });

// };
--- 
+++ 
@@ -6,6 +6,10 @@
 
 var PORT = process.env.PORT || 3000;
 
+
+// app.get('/', function (req, res) {
+//   res.sendFile(__dirname + '/socketTest.html');
+// })
 
 //models.sequelize.sync().then(function () {
 
@@ -18,9 +22,11 @@
       } else{
         client.emit('greeting', 'Hello, student. Please wait for your instructor to open a new poll.');
       }
+      //client.emit('openPoll', 'hello, its me');
     });
 
     client.on('newPoll', function(data) {
+      console.log('>>>>>>>>>',data);
       io.sockets.emit('openPoll', data);
     });
 
Delete zombie code from socket testing
