简体   繁体   English

无法在 heroku 上运行快速网关 - 无法绑定到 $PORT

[英]Not able to run express-gateway on heroku - failed to bind to $PORT

I'm trying to have the basic example express-gateway running on Heroku我正在尝试让基本示例 express-gateway 在 Heroku 上运行

    http:
      port: ${HTTP_PORT:-8080}
      hostname: ${HOST:-localhost}
    admin:
      port: 9876
      host: localhost
    apiEndpoints:
      api:
        host: 'localhost'
        paths: '/ip'
    serviceEndpoints:
      httpbin:
        url: 'https://httpbin.org'
...

Looking the logs I got the following error:查看日志我收到以下错误:

2021-02-15T18:53:09.947569+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

Any ideas?有任何想法吗?

I managed to fix that with the following config:我设法使用以下配置修复了该问题:

http:
  port: ${PORT:-8080}
https:
  port: ${PORT:-8081}
admin:
  port: 9876
apiEndpoints:
  api:
    paths: '/ip'

So the default port variable is called PORT and by removing all references to localhost所以默认端口变量称为 PORT 并通过删除对 localhost 的所有引用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM