# Ê â¢ÌØâ¢Ì) `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](https://github.com/cloudflare/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](https://dash.cloudflare.com). Documentation can be found [here](https://developers.cloudflare.com/workers/tooling/wrangler/).
To generate using Wrangler, run this command:
```bash
wrangler generate my-ts-project https://github.com/EverlastingBugstopper/worker-typescript-template
```
### ð© ð» Developing
[`src/index.js`](./src/index.ts) calls the request handler in [`src/handler.ts`](./src/handler.ts), and will return the [request method](https://developer.mozilla.org/en-US/docs/Web/API/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`](https://prettier.io/) 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](https://developers.cloudflare.com/workers/tooling/wrangler/commands/#publish).
## 𤢠Issues
If you run into issues with this specific project, please feel free to file an issue [here](https://github.com/cloudflare/workers-typescript-template/issues). If the problem is with Wrangler, please file an issue [here](https://github.com/cloudflare/wrangler/issues).
## â ï¸ 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](https://developers.cloudflare.com/workers/tooling/wrangler/configuration/environments/) to test things before deploying.
没有合适的资源?快使用搜索试试~ 我知道了~
rss-news-api:Awani RSS新闻-源码
共16个文件
ts:6个
json:4个
js:1个
需积分: 5 0 下载量 114 浏览量
2021-04-21
00:18:38
上传
评论
收藏 51KB ZIP 举报
温馨提示
ʕ•́؈•̀) workers-typescript-template typescript workers-typescript-template 包含电池的模板,用于启动TypeScript Cloudflare worker项目。 :battery: 入门 该模板旨在与一起使用。 如果您还不熟悉该工具,建议您安装该工具并将其配置为可与您的。 文档可以在找到。 要使用牧马人生成,请运行以下命令: wrangler generate my-ts-project https://github.com/EverlastingBugstopper/worker-typescript-template :woman: :laptop: 发展 在调用请求处理程序,并将返回给定请求的。 :test_tube: 测验 该模板随附有mocha测试,该测试仅测试请求处理程序可以处理每个请求方法。 npm test将运行您的测试。 :pencil: 格式设定 该模
资源详情
资源评论
资源推荐
收起资源包目录
rss-news-api-main.zip (16个子文件)
rss-news-api-main
package.json 1KB
wrangler.toml.example 163B
test
_setup.ts 180B
tsconfig.json 287B
handler.ts 507B
.prettierrc 105B
package-lock.json 177KB
src
router.ts 427B
controller
NewsController.ts 1KB
types
index.d.ts 99B
index.ts 706B
tsconfig.json 586B
.gitignore 49B
webpack.config.js 481B
.cargo-ok 0B
README.md 2KB
共 16 条
- 1
温暖如故
- 粉丝: 22
- 资源: 4642
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0