The Cloudflare Worker that powers the BotBlock.org API routes.
Read the API docs at https://botblock.org/docs.
- Create your 
development.envfile. Copydevelopment.env.sampleand fill out the information. - Authenticate with Wrangler by running 
wrangler login. - Update 
wrangler.tomlfor your account.- Use 
wrangler whoamito get your account ID, update the value inwrangler.tomlto match. - Use 
wrangler kv:namespace create "RATELIMIT"to create the KV namespace, update theidandpreview_idinwrangler.tomlto match. 
 - Use 
 - Clone a copy of BotBlock's open data with 
git clone https://github.com/botblock/data. - Develop with the worker by running 
npm run dev. 
wrangler.toml and this repository is currently designed for a staging deployment and a production deployment.
Ensure that you've created and configured staging.env and production.env appropriately.
Ensure that the staging/production environments in wrangler.toml have been updated with your zone IDs and routes for the workers.
Ensure that the KV namespaces are created for staging/production environments and are configured in wrangler.toml.
Use wrangler kv:namespace create "RATELIMIT" --env <staging/production>.
To deploy from local, run npm run publish:staging to deploy to staging, and npm run publish:production to deploy to the production environment.
To deploy using GitHub, run make deploy-staging to force push and deploy to staging, and make deploy-production to force push and deploy to the production environment.
Live logs for both environments can be accessed with npm run logs:staging and npm run logs:production as needed.