技術

heroku + node.jsでError R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch

投稿日:

こんにちは

heroku + node.jsでアプリを作っていて、いざherokuにpushしたらerrorがでました。

Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
Stopping process with SIGKILL
Process exited with status 137
State changed from starting to crashed

node serverを立てていなくてerrorがでてたので
expressでnode serverを作成。

もう一度push

またerror。。

port番号をローカル用に5000を設定していたのですが、herokuで決められたport番号を設定しないとerrorがでるようです。
なので下記に修正

const PORT = process.env.PORT || 5000;

これで正常に動くようになりました!

-技術

執筆者:


comment

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

このサイトはスパムを低減するために Akismet を使っています。コメントデータの処理方法の詳細はこちらをご覧ください

関連記事

no image

TypeScriptで連想配列の型定義をする

TypeScriptを書いているときに、毎回調べていたので簡単にまとめました。 …

[Angular6] Angularのユニットテストでprivate変数を読み込む

Angularでテストコードを書いている時、component側で定義しているp …

[Xcode] SDK Version Issue – This app was built with the iOS 12.0 SDK. Starting March 2019, all iOS apps submitted to the App Store must be built with the iOS 12.1 SDK or later, included in Xcode 10.1 or later.

こんにちは。たなかです。 2019年、ブログ初更新になります。今年もよろしくお願 …

プログラミンを触ってみた

2020年から小学校でのプログラミング教育が必修になる(かも?)ということで、 …

[正規表現]半角英数字&記号

どうも中田です。 今更ですが、正規表現の話。 正規表現でこんなパターンがほしい的 …