Skip to content

jrf0110/cf-workers-boilerplate

Repository files navigation

Warning! This is real old

Cloudflare Workers Boilerplate

Cloudflare workers autocompletion

Features

  • Strict TypeScript
  • Webpack bundling
  • Multiple worker targets
  • Workers preview
  • Testing
  • Routing with async middleware example
  • Error pages
  • CI with Circle

Error page

Coming soon

  • Preact + Edge-side rendering bundle
  • Deployment
  • KV Examples
  • Web Assembly with Wrangler

Getting started

Clone the repository and run:

# Install deps
yarn
# Build everything
yarn build
# Preview the api build
yarn preview:api

Incremental builds and tests

yarn build:watch & yarn test:watch

Targets

This project is setup so that one may build multiple Service Worker targets

Target: API

This targets demonstrates how one would create an HTTP API with Cloudflare Workers

Target: Tests

Any file that ends with _test.ts or _test.tsx will be run through