/cf-worker-typescript-template

ʕ •́؈•̀) TypeScript template for Cloudflare Workers

Primary LanguageTypeScript

ʕ •́؈•̀) cf-worker-typescript-template

A batteries included template for kick starting a TypeScript Cloudflare worker project.

Getting Started

This template is meant to be used with wrangler. If you are not already familiar with the tool, we recommend that you install the tool and configure it to work with your Cloudflare account.

To generate using wrangler, run this command:

wrangler generate my-ts-project https://github.com/EverlastingBugstopper/cf-worker-typescript-template

Developing

src/index.js calls the request handler in src/handler.ts, and will return the request method for the given request.

Testing

This template comes with mocha tests which simply test that the request handler can handle each request method. npm test will run your tests.

Formatting

This template uses tslint to format the project. To invoke, run npm run fmt.

Previewing and Publishing

For information on how to preview and publish your worker, please see the wrangler README.

Issues

If you run into issues with this specific project, please feel free to file an issue here. If the problem is with wrangler, please file an issue here.