First attempt at hosting an SSR site on cloudflare pages/workers so it might have nothing to do with the cloudflare adapter at all! but my routes locally have all started returning 400. Just wondered if it could be related to the way cloudflare adapter handles function/routing and something changed for me locally too? Previously they were working fine
src
|-pages
| |-api
| | |-dvla.ts
| | |-enquiry.ts
| |-index.astro
|
|-components
Routes called from components using fetch, like this in my MultiStepForm component:
const response = await fetch("/api/enquiry", {
method: "POST",
body: JSON.stringify({
...data
}),
});
enquiry.ts
export const POST: APIRoute = async ({ request }) => {}
All had been working fine. I've linked the error from chrome inspector below. Thanks for taking a look ๐