https://github.com/cloudflare/turnstile-demo-workers
A simple demo with a Turnstile-protected form, using Cloudflare Workers.
https://github.com/cloudflare/turnstile-demo-workers
cloudflare turnstile
Last synced: 6 months ago
JSON representation
A simple demo with a Turnstile-protected form, using Cloudflare Workers.
- Host: GitHub
- URL: https://github.com/cloudflare/turnstile-demo-workers
- Owner: cloudflare
- Created: 2022-09-23T14:29:10.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-21T09:57:40.000Z (about 1 year ago)
- Last Synced: 2025-03-30T02:08:21.572Z (6 months ago)
- Topics: cloudflare, turnstile
- Language: HTML
- Homepage: https://demo.turnstile.workers.dev/
- Size: 8.79 KB
- Stars: 232
- Watchers: 13
- Forks: 77
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Turnstile Demo: Workers
A simple demo with a Turnstile-protected form, using Cloudflare Workers.
With the code in this repository, we demonstrate [implicit rendering] and [explicit rendering].
## Setup
```sh
$ npm install
up to date, audited 103 packages in 585ms11 packages are looking for funding
run `npm fund` for detailsfound 0 vulnerabilities
```## Local testing
```sh
npm run dev> dev
> wrangler dev index.mjs --local⛅️ wrangler 2.1.7
-------------------
⎔ Starting a local server...
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ [b] open a browser, [d] open Devtools, [l] turn off local mode, [c] clear console, [x] to exit │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```Then press `b` to open the demo page in your browser.
## Deploy
```sh
$ npm run deploy> deploy
> wrangler publish index.mjs⛅️ wrangler 2.1.7
-------------------
Total Upload: 2.94 KiB / gzip: 1.33 KiB
Uploaded turnstile-demo-workers (2.07 sec)
Published turnstile-demo-workers (1.66 sec)
https://turnstile-demo-workers....workers.dev```
[implicit rendering]: https://demo.turnstile.workers.dev/
[explicit rendering]: https://demo.turnstile.workers.dev/explicit