aripalo
CDCloudflare Developers
•Created by aripalo on 3/10/2024 in #pages-help
Astro Hybrid output with Server Endpoints (API Routes)
Has anyone managed to get Astro with
output: "hybrid"
mode working in CloudFlare pages with Server Endpoints https://docs.astro.build/en/guides/endpoints/#server-endpoints-api-routes
Astro docs on CloudFlare adapter https://docs.astro.build/en/guides/integrations-guide/cloudflare/ claim that:
This adapter allows Astro to deploy yourBut no matter what, I haven't been able to to get API Routes working with CloudFlare pages on "hybrid" mode. If I change to "server" output, then the API routes immediately start working. I'm using latest dependencies of everything with minimal setup. I've tried all sorts of combinations. So with server mode and with this configuration, it works: … but if I change that output value tohybrid
orserver
rendered site to Cloudflare.
hybrid
, it stops working. Or it "works" but it acts like a Static Endpoint, always returning Hello World!
and ignoring the url search params.
My super simple test endpoint at src/pages/api/hello.ts
looks like this:
4 replies