Created
March 26, 2018 17:05
-
-
Save erdoganoksuz/43db40f93ee680f21c54e8573da361e0 to your computer and use it in GitHub Desktop.
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) { | |
if (event.request.url == "https://jsonplaceholder.typicode.com/posts/1") { | |
console.log(event) | |
var init = { | |
status: 200, | |
statusText: "OK", | |
headers: { | |
'Content-Type': 'application/json' | |
} | |
}; | |
var response = new Response('{Hello World"}', init); | |
event.respondWith(response); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment