(context)
| 1 | export async function onRequest(context) { |
| 2 | // Contents of context object |
| 3 | const { |
| 4 | request, // same as existing Worker API |
| 5 | env, // same as existing Worker API |
| 6 | params, // if filename includes [id] or [[path]] |
| 7 | waitUntil, // same as ctx.waitUntil in existing Worker API |
| 8 | next, // used for middleware or to fetch assets |
| 9 | data, // arbitrary space for passing data between middlewares |
| 10 | } = context; |
| 11 | |
| 12 | return new Response( |
| 13 | JSON.stringify({ |
| 14 | message: 'Hello, worker!', |
| 15 | context, |
| 16 | }) |
| 17 | ) |
| 18 | } |
nothing calls this directly
no outgoing calls
no test coverage detected