0

I'm trying to have the basic example express-gateway running on 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?

4

1 回答 1

0

我设法通过以下配置解决了这个问题:

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

因此默认端口变量称为 PORT 并通过删除对 localhost 的所有引用

于 2021-02-16T13:55:59.370 回答