Service Worker test repository. This is a very simple demo to show basic service worker features in action. The demo can be seen on our GitHub pages.
You can find a lot more out about how this works by reading Using Service Workers. In particular, read Why is my service worker failing to register? if you are having problems getting your code to do anything. You need to change the paths relative to where you are serving your files from!
To start server for this project, you can use a lightweight tool: https://chrome.google.com/webstore/detail/web-server-for-chrome/ofhbbkphhbklhfoeikjpcbhemlocgigb
Or if you have Python on your machine, you can just do as follow:
- cd to the project's parent directory
- run the commands below:
python -m SimpleHTTPServer 8001
python3 -m http.server 8001
then you just open: http://localhost:8001/sw-test/