![](/img/trans.png)
[英]Node.js upload error to Heroku, Web process failed to bind to $PORT within 60 seconds of launch
[英]How to bind port in Heroku With Node.js
Heroku 出现这样的错误
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60
seconds of launch
我认为端口不是问题但是很多文件说超时是端口问题
我的代码
const port = process.env.port || 8080;
app.listen(port, () => {
console.log(process.env.port);
console.log(`SERVER is running at ${port}`);
})
要在 Heroku 上使用环境变量,您需要在仪表板中设置它们。 打开https://dashboard.heroku.com/apps/YOUR_APP_NAME/settings ,然后单击REVEAL CONFIG VARS
按钮。 之后,您应该可以设置环境变量。 此外,如果您使用.env
文件,则需要将其删除。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.