I need to force my express.js app to "abort" after a given amount of time if there is no response, in order to avoid the heroku H12 timeout that make my dyno crash (which require a manual restart).
I tried to add req.setTimeout(15000)
, but it works only locally. On heroku my requests continue to wait for a response beyond the 15 second limit and the dyno crash once the heroku 30 second limit is reached.
Any suggestion ?