Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch)

前端 未结 24 2299
梦如初夏
梦如初夏 2020-11-22 05:42

I have my first node.js app (runs fine locally) - but I am unable to deploy it via heroku (first time w/ heroku as well). The code is below. SO doesn\'t let me write so much

24条回答
  •  一个人的身影
    2020-11-22 06:30

    It's worth mentioning that if your code doesn't specify a port, then it shouldn't be a web process and probably should be a worker process instead.

    So, change your Procfile to read (with your specific command filled in):

    worker: YOUR_COMMAND
    

    and then also run on CLI:

    heroku scale worker=1
    

提交回复
热议问题