And yeah, the second one is right there because the param passed to onRequest is a context not a req
And yeah, the second one is right there because the param passed to onRequest is a context not a req, env like in normal Workers
_routes.json (https://developers.cloudflare.com/pages/functions/routing/#create-a-_routesjson-file) is supported in Functions Advanced mode ?./_worker.js folder with a index.ts seems to be automatically transpiled and it works. But is this expected behavior?
functions: wuz herewrangler pages project create command, but I'm encountering problems when trying to access my functions.hello.js inside the functions directory with the following content:npx wrangler pages dev ./, I couldn't access it at http://localhost:8788/hello. Additionally, after deploying my project to Cloudflare Pages, I attempted to access my function at https://<my-project-name>.pages.dev/hello, but it didn't work either._routes.jsonAdvanced mode./_worker.jsindex.tsexport async function onRequestGet(context) {
console.log('Inside index.html proxy function ..')
return context.next()
}functions: wuz herewrangler pages project createhello.jsnpx wrangler pages dev ./http://localhost:8788/hellohttps://<my-project-name>.pages.dev/helloexport async function onRequest(context) {
return new Response("Hello, World!");
}