Pages Functions? No, not yet no. Certainly something they want to ship as soon as possible..
Pages Functions? No, not yet no. Certainly something they want to ship as soon as possible..
--binding flag with wrangler for now.

wrangler pages dev is the only one that I'm aware ofonRequestPost. I need to retrieve the header sent but nothing is mentioned on the Pages Functions doc... I tried applying the Workers doc suggestion but when I do so on Wrangler:Could not resolve "crypto" const customHeader = await context.request.headers.get('my-custom-header') Thanks for your quick wits wrangler.toml and vite.config.js? Been trying to get this to work for an embarrassing amount of timewrangler pages dev functionshttp://127.0.0.1:8788/api/ping





GET https://mydomain.com/api/hello 404
ResponseΒ {type: 'basic', url: 'https://mydomain.com/api/hello', redirected: false, status: 404, ok: false,Β β¦}
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request));
});
async function handleRequest(request) {
return new Response('Hello worker!');
}
async function fetchMovies() {
const response = await fetch('/api/hello');
// waits until the request completes...
console.log(response);
}
fetchMovies();
onRequestGet to handle requests: https://developers.cloudflare.com/pages/platform/functions/--bindingwranglerwrangler pages devonRequestPostexport async function onRequestPost(context) {
const customHeader = await context.headers.get('my-custom-header')
...
}Could not resolve "crypto" const customHeader = await context.request.headers.get('my-custom-header')wrangler.tomlvite.config.jswrangler pages dev functionshttp://127.0.0.1:8788/api/pingonRequestGet