Fixed the problem with socket.io not working, module.exports = function was overriding a previous exports.server call.