{"repo":"alvinwilta/cloudflare-worker-boilerplate","free":true,"listed":false,"github":"https://github.com/alvinwilta/cloudflare-worker-boilerplate","clone":"git clone https://github.com/alvinwilta/cloudflare-worker-boilerplate.git","description":"Simple boilerplate for Cloudflare Worker with Typescript with CRON schedule handler and KV integration","language":"TypeScript","stars":11,"topics":["typescript","boilerplate","cloudflare","cloudflare-workers","cloudflare-workers-cron","cloudflare-workers-kv","cron","edge","nodejs","starter-template"],"license":"MIT","category":"saas-starters-boilerplates","readme_excerpt":"Simple Cloudflare Worker Boilerplate Overview A boilerplate for Cloudflare's Edge Worker with request handler and CRON-triggered schedule handler. API Request Handler - / : Returns an OK status response. - /pages : Returns a 404 status response. - /dummy : Calls an API from https://dummyjson.com/products and calculates its price with the discounts provided. - /keyvalue : Uses Cloudflare's KV storage to store and retrieve the current time. CRON Trigger Handler Setting a 0 7 CRON trigger will use Cloudflare's KV storage to store and retrieve the current time. Usage To use this boilerplate, you will need a Cloudflare account and an active Workers subscription. Follow these steps to deploy the worker: 1. Clone the repository: 2. Install the required packages: 3. Log in to your Cloudflare account: 4. Create KV namespaces: 5. Update wrangler.jsonc with your KV namespace IDs and worker name: 6. Update allowedOrigins in src/configuration.ts with your allowed origins. 7. Copy .dev.vars.example to .dev.vars and fill in any required secrets for local development. 8. Deploy the worker: File Descriptions - src/interfaces/ : TypeScript interface definitions. - src/routes/ : Route handlers invoked for each API request. - src/configuration.ts : Allowed origins, HTTP methods, and API path definitions. - src/handler.ts : Request routing, CORS preflight handling, and scheduled event handler. - src/index.ts : Worker entry point. Validates methods, attaches CORS headers, and dispatches to handler","default_branch":null,"files":null,"tree":[],"storefront":"/r/alvinwilta","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/alvinwilta/cloudflare-worker-boilerplate/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}