I have a Nodejs app developed using Twitter API. When hosted on Heroku its giving the following error:
2018-12-14T10:00:03.678180+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2018-12-14T10:00:03.678256+00:00 heroku[web.1]: Stopping process with SIGKILL
2018-12-14T10:00:03.739029+00:00 heroku[web.1]: Process exited with status 137
On searching, I came across these StackOverflow question q1 q2 but both of them are using ExpressJS and listening onto a fixed port instead of the one provided by Heroku whereas my app is not using ExpressJS so, I don't understand where the problem lies. I also ran the app locally using heroku local
where its working fine. This Heroku article talks about the error but I can't relate it to my app article.
Can anyone explain this error and suggest possible solutions?
My code: code