heroku-caffeine
v1.4.1
Published
keeps your Heroku dynos awake
Downloads
14
Maintainers
Readme
Heroku Caffeine
Heroku Caffeine ☕️ keeps your Heroku dynos awake by perodically sending HTTP requests to your apps.
Features ✨
- Sends HTTP requests to all specified urls (apps) in specified interval
- Emits events
Event Types
- 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
Installation
$ npm i -S heroku-caffeine
Usage
const HerokuCaffeine = require('heroku-caffeine');
const herokuCaffeine = new HerokuCaffeine({ urls: ['https://your-heroku-app.herokuapp.com'] });
herokuCaffeine.run();
Development
Want to contribute? Great! 🔥 If you want you could follow this commit messages guide.
Install:
$ cd heroku-caffeine
$ npm i
Run:
$ npm run dev
Test Coverage:
$ npm run test-coverage
Lint Fix:
$ npm run lint-fix
and many other helpful scripts available in package.json 🤓