Skip to content

Instantly share code, notes, and snippets.

@jasonbyrne
Created April 27, 2020 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonbyrne/479a33c3258a5dba6dcc62fe086ae5ef to your computer and use it in GitHub Desktop.
Save jasonbyrne/479a33c3258a5dba6dcc62fe086ae5ef to your computer and use it in GitHub Desktop.
Simplest CDN Worker
function handleRequest(request: Request): Promise<Response> {
return fetch(request);
}
addEventListener('fetch', (event) => {
event.respondWith(handleRequest(event.request))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment