【问题标题】:Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch NODE on heroku错误 R10(引导超时)-> 在 heroku 上启动 NODE 后 60 秒内,Web 进程无法绑定到 $PORT
【发布时间】:2020-11-23 18:31:36
【问题描述】:

请我的应用程序无法在 heroku 上运行,heroku 无法绑定到主机端口。

我总是收到Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

我需要帮助来解决这个问题。

我的index.js 代码如下所示。

import http from 'http';
import app from './app';
import dotenv from 'dotenv';

dotenv.config();

const PORT = process.env.PORT || 3000;

const server = http.createServer(app);
console.log('PORT: ', PORT)
server.listen(PORT,'0.0.0.0', () => {
  console.log(`server listening on localhost: ${PORT}`);
});

节点:12.16.1 npm:6.13.4

我也尝试过在线提供的解决方案,但都无济于事。

【问题讨论】:

    标签: node.js heroku deployment


    【解决方案1】:

    您可以尝试将 Heroku here 上的启动超时时间增加到最大值(免费计划为 120 秒)。

    我遇到了同样的问题,但在 Springboot 应用程序上。连接数据库耗时超过 60 秒,无法及时(

    【讨论】:

      猜你喜欢
      • 2016-03-08
      • 1970-01-01
      • 2015-09-14
      • 2021-07-26
      • 2017-06-22
      • 1970-01-01
      • 2021-04-05
      • 2021-05-17
      • 2021-08-19
      相关资源
      最近更新 更多