HaxSam / cloudflare-worker-template

A template for cloudflare worker to use Typescript and a simple Routing class

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cloudflare-worker-template

A template for Cloudflare Worker written in Typescript


Importend

I use pnpm for the install when you use npm or yarn you have to change it.

For more depth how to use Cloudflare Worker in Typescript go to the following repo worker-typescript-template

Examples

Here some repos where this template is used

kv-store-api

Usage

Use the command

wrangler generate my-ts-project https://github.com/HaxSam/cloudflare-worker-template/

Change the following files with your information

  • wrangler.toml
name = "cloudflare-worker-template"
...
command = "pnpm install && pnpm build"
  • package.json
{
	"name": "cloudflare-worker-template",
	"version": "1.0.0",
	"description": "A template for creating a Cloudflare Worker with Typescript and a simple Routing class",
	"author": "HaxSam",
}

License

Copyright for portions of project cloudflare-worker-template are held by [Github Account HaxSam Owner, 2022] as part of project worker-typescript-template

All other copyright for project cloudflare-worker-template are held by [Github Account HaxSam Owner, 2022].

Check the LICENSE for more details.

About

A template for cloudflare worker to use Typescript and a simple Routing class

License:MIT License


Languages

Language:TypeScript 86.7%Language:JavaScript 13.3%