Heroku上的express-gateway-{$ PORT}绑定错误

问题描述 投票:0回答:1

我已经通过gateway.config.yml文件中的env变量在Heroku上部署了Express-gateway:

http:
  port: ${PORT:-8080}
  host: ${HOST:-localhost} 
https:
  port: ${PORT:-8080}
  host: ${HOST:-localhost}   
apiEndpoints:
  ....

无论如何Heroku总是出现此错误:

[EG:gateway] gateway http server listening on :::8080

State changed from starting to crashed

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

我根据${ENV_VAR_NAME:-DEFAULT}使用了符号official documentation。为什么Heroku试图绑定8080?

heroku express-gateway
1个回答
1
投票

您不应该在同一端口上同时监听http和https服务器,否则它将失败。

Heroku为您提供了自己的路由器来处理SSL终止,因此您只需删除整个https部分。

© www.soinside.com 2019 - 2024. All rights reserved.