Skip to content
项目

cloudflare/worker-typescript-template

在 GitHub 查看

关于

ʕ •́؈•̀) Cloudflare Workers 的 TypeScript 模板

开发工具

这些数字如何统计

实测星标增长

24小时
+1
7天
0
15天
正在收集历史
1个月
正在收集历史

各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。

README.md

原文

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

⚠️ Warning: This template is no longer maintained

Create TypeScript workers in the command-line with Wrangler 2.0.0+ using wrangler init instead.


A batteries included, with the latest Wrangler, template for kick starting a TypeScript Cloudflare worker project.

Note: You must use wrangler 1.17 or newer to use this template.

🔋 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/cloudflare/worker-typescript-template

👩 💻 Developing

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

🧪 Testing

This template comes with jest tests utilizing Miniflare 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.

探索相关项目

加载中…