Created
April 27, 2020 13:07
-
-
Save jasonbyrne/479a33c3258a5dba6dcc62fe086ae5ef to your computer and use it in GitHub Desktop.
Simplest CDN Worker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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