Slide 29
Slide 29 text
export async function onRequest(context) {
const {
request, // same as existing Worker API
env, // same as existing Worker API
params, // if filename includes [id] or [[path]]
waitUntil, // same as ctx.waitUntil in existing Worker API
next, // used for middleware or to fetch assets
data, // arbitrary space for passing data between middlewares
} = context;
return new Response('Hello, Worker!');
}
Hello Worker Example with Pages Functions!
/functions/api/hello.js
@lauragift_