Can you deploy both static assets and back-end apis in the same worker?
I'm trying to deploy a Hugo static site with a contact form, and have the contact form interact with an /api/contact worker deployed from the same repository. is this possible with wrangler?
I asked the AI overlords for help, and this is what it spit out for me:
I asked the AI overlords for help, and this is what it spit out for me:
4 Replies
the idea is that rather than embedding the slower-loading form directly from fillout, I'll create a form in my static site, and the submit triggers JS that packages the form up and sends to a worker, where the worker has the API key for Fillout and submits the form directly to their API.
this way the site loads fast as a static site does, and I don't need to have the embed AND i don't need to try figuring out how to allow the embedded fillout form in the content security policy.
That doesn’t look like valid syntax for a wrangler.toml?
Cloudflare Docs
Configuration
Use a configuration file to customize the development and deployment setup for your Worker project and other Developer Platform products.
Thanks for that link - I reworked the toml and i'm getting closer:
Thank you for your help!