GithubHelp home page GithubHelp logo

hartl3y94 / templates Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cloudflare/templates

0.0 0.0 0.0 25.84 MB

A collection of stater templates and examples for Cloudflare Workers and Pages

Home Page: https://cloudflareworkers.com

License: MIT License

Shell 0.25% JavaScript 57.54% Python 0.40% C 0.66% Rust 0.57% TypeScript 33.58% CSS 0.24% COBOL 0.05% HTML 6.72%

templates's Introduction

Cloudflare Workers – Templates & Examples

Cloudflare Workers make it possible to write Javascript which runs on Cloudflare’s network around the world. Using Workers you can build services which run exceptionally close to your users. You can also intercept any request, which would ordinarily travel through Cloudflare to your origin, and modify it in any way you need. Workers can make requests to arbitrary resources on the Internet, perform cryptography using the WebCrypto API, or do nearly anything you'd typically configure a CDN to accomplish.

This repository contains a collection of starter templates and examples of how Workers can be used to accomplish common tasks. You are welcome to use, modify, and extend this code! If you have an additional example you think would be valuable, please submit a pull request.

Questions about Workers? Please join the Cloudflare Developers Discord!

Usage

There are a few ways to quickly jumpstart your next project using one of the templates found within this repository:

  1. Local development, via CLI quickstart utility

    You may use yarn, pnpm, or npm to invoke the create-cloudflare package.

    Note: All recent versions of npm, yarn, and pnpm support this feature!

    You may select the name of any subdirectory within this repository to create your project; for example, worker-typescript and examples/fast-google-fonts are both valid subdirectory names.

    To create a my-project directory using the worker-typescript template, you may run one of the following commands:

    Note
    This package has now been sunsetted! We recommend using the wrangler generate [name] [template] command to create new projects with templates.

    $ npm init cloudflare my-project worker-typescript
    # or
    $ yarn create cloudflare my-project worker-typescript
    # or
    $ pnpm create cloudflare my-project worker-typescript
  2. Local development, via full repository clone

    You may clone this entire repository and copy the desired subdirectory to your target location:

    # full repository clone
    $ git clone --depth 1 https://github.com/cloudflare/templates
    
    # copy the "worker-typescript" example to "my-project" directory
    $ cp -rf templates/worker-typescript my-project
    
    # setup & begin development
    $ cd my-project && npm install && npm run dev

Contributing

Please ensure the test npm-script passes. Any formatting errors can typically be autofixed by running the format npm-script. This is enforced in CI for all pull requests.

If adding a new template, please pick a unique name and aim for simplicity and clarity. Contributions that are meant for Workers must begin with the worker- prefix, while those meant for Pages must have the pages- prefix.

License

MIT

templates's People

Contributors

a-robinson avatar adamschwartz avatar adaptive avatar ashleygwilliams avatar ashleymichal avatar dependabot[bot] avatar eidam avatar ekwuno avatar electroid avatar elithrar avatar everlastingbugstopper avatar exvuma avatar gregbrimble avatar grempe avatar irvinebroque avatar ispivey avatar jacobmgevans avatar jb3 avatar kristianfreeman avatar lauragift21 avatar lukeed avatar nilslice avatar pmeenan avatar rita3ko avatar samuelcolvin avatar vasturiano avatar xortive avatar xtuc avatar zackbloom avatar zaherg 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.