Worker Registration
Good Job! Now, in the root of your static directory, create a file called sw.js
and paste the following code into it.
Great! Now, assuming you have a script linked to your site already, you need to paste this code into your JavaScript file.
This is the code that will register the service worker and scope it to the /service/
path.
Edit on GitHub
Last updated on