GithubHelp home page GithubHelp logo

cloudflare-worker-test's Introduction

ʕ •́؈•̀) workers-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. Documentation can be found here.

To generate using Wrangler, run this command:

wrangler generate my-ts-project https://github.com/EverlastingBugstopper/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 prettier to format the project. To invoke, run npm run format.

👀 Previewing and Publishing

For information on how to preview and publish your worker, please see the Wrangler docs.

🤢 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.

⚠️ Caveats

The service-worker-mock used by the tests is not a perfect representation of the Cloudflare Workers runtime. It is a general approximation. We recommend that you test end to end with wrangler dev in addition to a staging environment to test things before deploying.

cloudflare-worker-test's People

Contributors

mcansh avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.