Skip to content

Instantly share code, notes, and snippets.

@seriousManual
Created June 24, 2013 16:20
Show Gist options
  • Save seriousManual/5851332 to your computer and use it in GitHub Desktop.
Save seriousManual/5851332 to your computer and use it in GitHub Desktop.
var server;
var app = express();
fooHandler.on('initialized', function(error) {
server = app.listen(configuration.port);
});
process.on('uncaughtexception', function (error) {
//throws if the server is not acutally running
server.close(function() {
process.exit(1);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment