Deno port of heroku-keep-awake
import { wakeDyno, wakeDynos } from "https://deno.land/x/heroku_awakener/mod.ts";
const url = 'https://seoul-tracker.herokuapp.com/'
wakeDyno(url, {
interval: 10 // 10 minutes
});
const urls = ['https://kaffeine.herokuapp.com/', 'https://swapi-trybe.herokuapp.com/']
wakeDynos(urls, {
interval: 29,
stopTimes: {
start: '6:00', // 6AM
end: '13:00' // 13PM
}
});
Alternatively, you can use it directly from the CLI by using deno run
:
# Single heroku app
deno run --allow-net https://deno.land/x/heroku_awakener/cli.ts --url <url> --interval <interval> --stopStart <start> --stopEnd <end>
# Multiple heroku apps (separate urls with comma eg. https://swapi-trybe.herokuapp.com/,https://kaffeine.herokuapp.com/)
deno run --allow-net https://deno.land/x/heroku_awakener/cli.ts --urls <urls> --interval <interval> --stopStart <start> --stopEnd <end>
You can also install it globally using the following:
deno install --allow-net -n heroku-awakener https://deno.land/x/heroku_awakener/cli.ts
Then, the package is available to run:
heroku-awakener --url|--urls <urls|urls> --interval <interval> --stopStart <start> --stopEnd <end>
Required permissions:
--allow-net
Run tests:
deno test --allow-net