Skip to content

yhorian/pages-plugin-static-forms

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static Forms Pages Plugin for Cloudflare

Bug fixed that cause all Response objects passed to have a 200 OK status code. Now you can add a redirect!

Added support for Cloudflare Turnstile.

Installation

npm i --save https://github.com/yhorian/pages-plugin-static-forms

Copy the functions/_middleware.ts file from this repository over to your own /functions folder. Cloudflare will then compile it when it builds.

If you've changed the "turnstile = false" setting to true, you'll also need to add a widget to the form and add your secret key as an environment variable named 'TURNSTILE_KEY' when installing the Turnstile code.

To use multiple middleware handlers or change the routes used, see this documentation on Chaining middleware.

Usage

Edit the _middleware.ts to do whatever you'd like with the form submission data. Every time a form submits, it'll capture and run the code you insert.

Documentation available on Cloudflare's Developer Docs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published