Various workers that I need in personal projects.
The current implementation relies on ClojureScript.
You'll need one terminal per command.
In the project root:
$ npm run watch
> cloudflare-workers@0.0.1 watch
> shadow-cljs watch workers
shadow-cljs - config: /home/cokap/git/cloudflare-workers/shadow-cljs.edn
shadow-cljs - server version
...
$ cd backblaze-download-token-to-secrets # or any other worker folder
$ npm run watch
> backblaze-download-token-to-secrets@0.0.1 watch
> esbuild main.js --watch --bundle --platform=neutral --keep-names --format=esm --define:process.env.NODE_ENV="dev" --define:window=global --outfile=./out/bundle.js
...
We take advantage of wrangler's development server:
$ cd backblaze-download-token-to-secrets # or any other worker folder
$ npm run dev
> backblaze-download-token-to-secrets@0.0.1 dev
> wrangler dev --local
...
You can use curl
for triggering the desired workers, for instance this is what you would run for a Scheduled worker.
$ curl "http://localhost:8787/cdn-cgi/mf/scheduled"
Check the miniflare documentation for more info.