Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thomasvincent/terraform-cloudflare-maintenance
Maintains a responsive Cloudflare-based maintenance page (Terraform).
https://github.com/thomasvincent/terraform-cloudflare-maintenance
cloudflare cloudflare-workers maintenance terraform
Last synced: 11 days ago
JSON representation
Maintains a responsive Cloudflare-based maintenance page (Terraform).
- Host: GitHub
- URL: https://github.com/thomasvincent/terraform-cloudflare-maintenance
- Owner: thomasvincent
- License: apache-2.0
- Created: 2022-03-17T09:02:44.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-06-28T00:22:40.000Z (4 months ago)
- Last Synced: 2024-06-28T01:54:47.350Z (4 months ago)
- Topics: cloudflare, cloudflare-workers, maintenance, terraform
- Language: JavaScript
- Homepage:
- Size: 627 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE_APACHE
- Security: SECURITY.md
Awesome Lists containing this project
README
# ʕ •́؈•̀) `worker-typescript-template`
A batteries included template for kick starting a TypeScript Cloudflare worker project.
## Note: You must use [wrangler](https://developers.cloudflare.com/workers/cli-wrangler/install-update) 1.17 or newer to use this template.
## 🔋 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/cloudflare/worker-typescript-template
```### 👩 💻 Developing
[`src/index.ts`](./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 jest 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/worker-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.