var server = app.listen();
server.setTimeout(500000);
inspired by https://github.com/expressjs/express/issues/3330
or
app.use(function(req, res, next){
res.setTimeout(500000, function(){
// call back function is called when request timed out.
});
next();
});