Last active
August 28, 2015 06:35
-
-
Save L8D/5e8eae75efa3c80b6e87 to your computer and use it in GitHub Desktop.
Setting ExpressJS server timeout using best practices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'), | |
http = require('http'), | |
app = express(); | |
var server = http.createServer(app); | |
var timeout = 0; | |
server.setTimeout(timeout, function() { | |
server.listen(app.get('port'), function() { | |
console.log("Express server listening on port %d in %s mode", app.get('port'), app.get('env')); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the best practice for getting this to stay alive. Execution finishes before the server.listen process gets kicked off.