var http = require('http');
var auth = require('./auth');
var watch = require('./watch');
var pubsub = require('./pubsub');
var rootdir = __dirname + '/../';


var server = http.createServer(function (req, responseToSend) {

    var file = req.url;

    if (file == '/') {
        auth.setup(watch.start)
    }

    else if (file == '/newThread') {

        console.log("HIT END POINT, REQ IS");
        console.log(req);
        //pubsub.receivedMessage(req);
    }

    responseToSend.end();

});

server.listen(process.env.PORT || 8080);

console.log("Port currently being used is: " + (process.env.PORT || 8080));
var http = require('http');
var auth = require('./auth');
var watch = require('./watch');
var pubsub = require('./pubsub');
var rootdir = __dirname + '/../';


var server = http.createServer(function (req, responseToSend) {

    var file = req.url;

    if (file == '/') {
        auth.setup(watch.start)
    }

    else if (file == '/newThread') {

        console.log("HIT END POINT, REQ IS");
        console.log(req);
        //pubsub.receivedMessage(req);
    }

    else if (file.match(/authenticated*/)) {

        responseToSend.write("Authenticated!");
    }

    responseToSend.end();

});

server.listen(process.env.PORT || 8080);

console.log("Port currently being used is: " + (process.env.PORT || 8080));
Add authenticate page