October 2017
Intermediate to advanced
302 pages
7h 27m
English
Remember the distinction about service workers--they are a piece of our site, but run outside our application code. With that in mind, our service worker will live inside public/ folder, and not in src/ folder.
Then, create a file called sw.js in your public/ folder. We'll keep it simple for now; just add a single console.log inside:
console.log("Service worker running!");
The real work (registering the service worker) will be done inside our index.html. For this process, we want to do the following:
Let's move through the steps one by one. First, let's create an empty script ...
Read now
Unlock full access