![](/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.