var http  = require('http');
var app   = require('./app');

module.exports = http.createServer(app).listen(app.get('port'), function() {
  console.log("Express server listening on port " + app.get('port'));
});

var app = require('./app');

module.exports = app.listen(app.get('port'), function() {
  console.log("Express server listening on port " + app.get('port'));
});

Use app.listen instead of http.createServer
Use app.listen instead of http.createServer
