My service worker sandbox
A service worker is a script that is run by your browser in the background, separate from a web page, opening the door to features which don't need a web page or user interaction. Today, they already include features like push notifications and in the future it will include other things like, background sync, or geofencing. The core feature discussed in this tutorial is the ability to intercept and handle network requests, including programmatically managing a cache of responses.
The reason this is such an exciting API is that it allows you to support offline experiences, giving developers complete control over what exactly that experience is. HTML5 Rocks (2014)
$ git clone https://github.com/dleitee/service-worker-sandbox.git
$ cd service-worker-sandbox
$ npm install
$ node index.js
Open your browser and access: http://localhost:3000
If you use Chrome, open ChromeDevTool -> Network and change option No Throttling to Offline and refresh page.
If you use other browser, disconnect your server and refresh page.
Open your browser and access: http://localhost:3000/undefined-url