问题描述
我正在尝试在 Heroku 上运行基本示例 express-gateway
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'
...
查看日志我收到以下错误:
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
有什么想法吗?
解决方法
我设法通过以下配置解决了这个问题:
http:
port: ${PORT:-8080}
https:
port: ${PORT:-8081}
admin:
port: 9876
apiEndpoints:
api:
paths: '/ip'
因此默认端口变量称为 PORT 并删除对 localhost 的所有引用?