I'm struggling to use a page function (for a simple contact form) with Astro

I've been following https://developers.cloudflare.com/pages/functions/plugins/static-forms/, I've put code in functions/contact.js: import staticFormsPlugin from "@cloudflare/pages-plugin-static-forms"; export const onRequest: PagesFunction = staticFormsPlugin({ respondWith: ({ formData, name }) => { const email = formData.get("email"); return new Response( Hello, ${email}! Thank you for submitting the ${name} form., ); }, }); But it fails to recognise and deploy the function with Pages. Nor is there any mention of it in the routes (which are meant to be auto generated?). Not sure what I'm doing wrong, tbh.
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server