Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gswalden/heroku-scaler
Simple script to scale free Heroku dynos up or down.
https://github.com/gswalden/heroku-scaler
Last synced: 8 days ago
JSON representation
Simple script to scale free Heroku dynos up or down.
- Host: GitHub
- URL: https://github.com/gswalden/heroku-scaler
- Owner: gswalden
- License: mit
- Created: 2015-07-08T01:13:40.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-07-12T00:53:31.000Z (over 9 years ago)
- Last Synced: 2024-10-13T08:51:25.263Z (24 days ago)
- Language: JavaScript
- Size: 129 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Heroku Scaler
`HEROKU_TOKEN=token-here APP_NAME=name-here npm start on` to scale up your free dyno.
`HEROKU_TOKEN=token-here APP_NAME=name-here npm start off` to scale down your free dyno.
To run from Heroku Scheduler, first `npm install --save heroku-scaler` and deploy to Heroku. Then, in Scheduler, schedule the command `HEROKU_TOKEN=token-here APP_NAME=name-here node ./node_modules/heroku-scaler/bin/heroku-scaler.js on` (or `off`). Alternatively, set the environment variables beforehand, and just use `node ./node_modules/heroku-scaler/bin/heroku-scaler.js on` or `node ./node_modules/heroku-scaler/bin/heroku-scaler.js off`.
In your app's `package.json`, you can add these tasks to the `scripts` field for even simpler execution.
```json
{
"scripts": {
"heroku-on": "node ./node_modules/heroku-scaler/bin/heroku-scaler.js on",
"heroku-off": "node ./node_modules/heroku-scaler/bin/heroku-scaler.js off"
}
}
```
`npm run-script heroku-on` and `npm run-script heroku-off` should now work.