πScheduled Workers
Quick Start Guide
Context & Stack
All scheduled workers (cron jobs) used in the project, have been developed on the CloudFlare Workers platform.
The application currently uses only one worker, and its purpose and requirements can be found in its specific guide, located here:
Chuck-NORRISRunning Locally
The wrangler tooling is required for running the worker locally, install using this command:
npm i -g wrangler@latestcd into the folder of the desired worker and Install dependencies:
npm installAdd requisite environment variables, as per the guide of the specific worker, in the wrangler.toml file. Variables must be added in the following format:
[vars]
VAR_1 = "..."
VAR_2 = "..."Run the worker using the following command:
wrangler dev --localTo trigger the worker manually visit the following link:
Replace [PORT] with the assigned local port.
Deployment
Deployment can only be done on the Cloudflare platform.
Wrangler is required for deployment, install the package if you haven't already:
cd into the folder containing the worker that needs to be deployed and run the following command:
Running the command for the first time, would require you to login to your cloudflare account.
Once deployed, set the required environment variables from the worker settings page in your cloudflare dashboard.
Last updated