Can Pages and Workers be in same project


I am new to using Cloudflare. I wish to create a JAM stack project using static HTML web site (Nuxt based) and APIs for dynamic data.

I have been able to create my Nuxt site and set up Pages.

Is there a way to place the API code using workers as a subdirectory of my project?


You can try using the open beta of Pages Functions, which run on Workers: Functions · Cloudflare Pages docs

As well as the normal functions routing (Preferable for an API), there’s also an “Advanced mode” which will let you write your own custom Worker code in front of the Pages project as _worker.js: Functions · Cloudflare Pages docs


Thanks @Erisa for your prompt response. Let me check the above links

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.