Heroku Caffeine ☕️ keeps your Heroku dynos awake by perodically sending HTTP requests to your apps.
- Sends HTTP requests to all specified urls (apps) in specified interval
- Emits events
- init - object is properly created. Contains HerokuCaffeine (this) object.
- pinging - starting sending requests. Contains list of urls to ping.
- pinged - sent request to the certain app. Contains pinged url.
- pingedall - all urls are pinged. Contains lis of pinged urls.
- endedpinginginterval - interval has ended. Waiting for another interval. Contains results from pinging the urls.
- error - error has occurred, e.g. list of urls is not valid
- warn - warning (doesn't terminate the app), e.g. one of the urls in the list is invalid
$ npm i -S heroku-caffeine
const HerokuCaffeine = require('heroku-caffeine');
const herokuCaffeine = new HerokuCaffeine({ urls: ['https://your-heroku-app.herokuapp.com'] });
herokuCaffeine.run();
Want to contribute? Great! 🔥 If you want you could follow this commit messages guide.
$ cd heroku-caffeine
$ npm i
$ npm run dev
$ npm run test-coverage
$ npm run lint-fix
and many other helpful scripts available in package.json 🤓