Where to place functions with custom build configuration? / Static Forms Plugin not working

Hey, I'm trying to use the static forms plugin (https://developers.cloudflare.com/pages/functions/plugins/static-forms/) and in theory I just need to add a /functions/_middleware.ts file, but I'm not sure where they should be. I have the attached build configuration, but should I create the functions directory in /, /frontend, or /frontend/build? In any case, trying it locally with npx wrangler pages dev build (running in /frontend and after npm run building manually) seems to find the _middleware.ts file in /frontend/functions because it fails to build if I don't have the plugin npm installed. However, even though it is supposedly building the function, it doesn't really do anything - when I visit the website, the form still has data-static-form-name and its method/action attributes has not been overwritten. Would appreciate a pointer on what I'm doing wrong. Thanks in advance!
No description
2 Replies
RafDev
RafDev3mo ago
I've pushed to GitHub to trigger a deployment and it seems to find the functions, but still nothing is happening, and logs don't show any trace of the middleware being run
No description
No description
RafDev
RafDev3mo ago
...and function metrics show 0 requests
No description