Skip to content

Instantly share code, notes, and snippets.

@joerx
Created June 7, 2014 17:13
Show Gist options
  • Save joerx/507094676a095bb719a5 to your computer and use it in GitHub Desktop.
Save joerx/507094676a095bb719a5 to your computer and use it in GitHub Desktop.
var express = require('express');
var app = express();
// ...
module.exports = app;
var app = require('./app');
app.set('port', process.env.PORT || 3000);
app.listen(app.get('port'), function() {
console.log('Express server listening on port ' + app.get('port'));
});
@joerx
Copy link
Author

joerx commented Jun 7, 2014

Setting up express.js separating app bootstrapping and server startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment