Add demo worker

This commit is contained in:
Sam Carlton 2022-02-03 19:33:31 -06:00
parent 63589a079a
commit a4186bafdf
10 changed files with 348 additions and 0 deletions

View file

@ -0,0 +1,13 @@
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* Respond with hello worker text
* @param {Request} request
*/
async function handleRequest(request) {
return new Response('Hello worker!', {
headers: { 'content-type': 'text/plain' },
})
}