NodeJS应用失败,错误为“错误R10(引导超时)-> Web进程在启动后60秒内未能绑定到$ PORT”

问题描述 投票:0回答:1

[在尝试启动应用程序时出现错误,提示Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch,我敢肯定我已将应用程序配置为使用Heroku提供的$ PORT env变量,因为我可以看到以下行显示为Server running on 38594日志中,每次重新启动dyno时,端口都会更改,我尝试使用heroku run bash登录bash并使用node dist/bundle/index.js从那里启动应用程序,并且它可以正常工作,但是我仍然无法打开该应用程序通过浏览器,有人可以帮我指出正确的方向吗?欢呼声

node.js heroku purescript
1个回答
0
投票

原来HTTPure试图绑定到localhost,而Heroku允许0.0.0.0而不是localhost。最令人困惑的部分是HTTPure的master分支绑定到0.0.0.0 https://github.com/cprussin/purescript-httpure/blob/master/src/HTTPure/Server.purs#L84,而我正在使用的发行版则绑定到localhost,解决方法是使用serve'0.0.0.0绑定到正确的主机名

© www.soinside.com 2019 - 2024. All rights reserved.