S0le (art commission open)
CDCloudflare Developers
•Created by S0le (art commission open) on 10/25/2023 in #general-help
Integrating Static HTML Frontend with Worker Backend on Cloudflare Pages
Hey all,
I'm currently working on a something that hosts a static HTML frontend on Cloudflare Pages, which will integrate with a backend service set up as a Cloudflare Worker.
The ultimate goal is to embed the HTML in a webpage either as an element or iframe (due to CMS limits), users can click on it to activate the frontend and do some calculations.
I've already written the backend in JavaScript and deployed it using Wrangler, and I have written the frontend which is just a custom HTML page that calls the backend to perform specific calculations based on user inputs.
The frontend correctly sends data to the backend, and the backend successfully returns calculated results.
However, I'm stuck on deploying the static HTML frontend to Cloudflare Pages. I've never worked with Cloudflare Pages before, and I'm a bit lost on how to integrate it with my existing Worker backend, all I've done is uploaded the static HTML, but the domain created from it cannot seem to resolve.
Is there any information or past successes on this specific How do I deploy my static HTML to Cloudflare Pages and calling a worker from it?
What's the best way to link this frontend with my existing backend worker?
Thanks in advance!
3 replies