-
-
Save albertoperezf/ba9d9b931552afe62796257143b2de75 to your computer and use it in GitHub Desktop.
Service Worker template
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
self.addEventListener('fetch', function(event) { | |
// TODO: respond to all requests with an html response | |
// containing an element with class="a-winner-is-me". | |
// Ensure the Content-Type of the response is "text/html" | |
console.log(event.request); | |
event.respondWith( | |
new Response('<strong class="a-winner-is-me">Hello Alberto</strong>', { | |
headers: { | |
'foo': 'bar', | |
'content-type': 'text/html' | |
} | |
}) | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment