4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Herokuでアイドルさせないようにした際のメモ

Posted at

Herokuでは30分ごとにアイドル状態になってしまうため、定期的にアクセスしてアイドル状態にさせないようにした。
アプリケーションは node.js+exprss で立てたwebサーバー

webサーバーにstatus:200を返すよう設定

こんな感じにした

route/index.js
router.get('/status', (req, res) => {
    res.writeHead(200, {'Content-Type': 'application/json; charset=utf-8'});
    res.end(JSON.stringify({status: 'ok'}));
});

やったこと

  1. Uptime Robotに登録
  2. "Add New Monitor" をクリック
  3. "Monitor Type" に "HTTP(s)" を選択
  4. "Friendly Name" は適当に
  5. "URL"に "HerokuのURL"/status を入力
  6. "Monitoring Interval" は20分ぐらいに設定
4
4
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?