2
我想在Heroku上部署nodejs lite-server。我能夠在本地運行的服務器很好,但與此錯誤失敗的部署:如何爲heroku配置lite服務器端口?
Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
的基本問題是我不知道如何讓Heroku的設置端口。他們動態地做到這一點(我只知道如何靜態地做)。所以我需要設置一個環境變量,以便服務器可以設置正確的端口。我如何使用lite-server來做到這一點?
這個問題已經爲不同的服務器設置了地址:
配置HTTP服務器端口的Heroku
Heroku + node.js error (Web process failed to bind to $PORT within 60 seconds of launch)
要配置Express服務器端口的Heroku
謝謝,一個音符不過,這其實是一個.js腳本動態獲取Heroku上一個以.json文件只能被用靜態端口,因爲端口號會被硬編碼使用的端口。 –