help with astro framework deployment to cloudflare workers
I'm deploying an Astro project to Cloudflare Workers following the static assets guide, but I'm stuck with API routing.
With React projects, Cloudflare creates separate src and worker folders, with backend code in the worker folder. However, my Astro project doesn't have a worker folder.
I tried manually creating a worker folder with code to handle API routes, but all fetch requests to /api/... return 404 errors, despite my worker code being set up to respond with test messages.
How do I correctly structure an Astro project for Cloudflare Workers to support both frontend pages and API routes? Is the setup different from React projects?
1 Reply
Cloudflare Docs
Astro · Cloudflare Pages docs
Astro is an all-in-one web framework for building fast, content-focused websites. By default, Astro builds websites that have zero JavaScript runtime code.