cloudflare / workers-docs

🌥👷‍♀️ The documentation site for Cloudflare Workers
https://developers.cloudflare.com/workers
106 stars 151 forks source link

How to mix functions into a worker-site? #982

Closed rathboma closed 4 years ago

rathboma commented 4 years ago

Hey team!

Excited to explore Cloudflare workers and worker sites for my product's website. One question I have is -- the docs for worker sites don't show how to mix regular functions into my static site, and I'm not sure how that would work?

Eg, for Netlify you just create a 'functions' directory and put them in there. I imagine it's not that different, do you have any examples?

Eg - I'd love to have /api/foo be a function call

rathboma commented 4 years ago

?

jclee commented 4 years ago

For context: There was a project to rework the Cloudflare Worker docs. The new docs are in a new repo (https://github.com/cloudflare/cloudflare-docs/tree/master/products/workers), so the remaining open issues in this repo are being closed.

As far as the ability to run a worker in front of static site content, it looks like this page in the new docs might be helpful?: https://developers.cloudflare.com/workers/platform/sites/start-from-worker