簡體   English   中英

無法在 heroku 上運行快速網關 - 無法綁定到 $PORT

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

我正在嘗試讓基本示例 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'
...

查看日志我收到以下錯誤:

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 的所有引用

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM