October 2017
Intermediate to advanced
370 pages
8h 57m
English
To complete the example, we need a page that will be the PWA itself. Strictly, to qualify as a PWA, it needs a manifest.json file and a service worker. We have both of these already.
The PWA itself will be a non-AMP HTML document. It will contain JavaScript code to install the service worker (for users that don't arrive via the AMP page), and we'll link to the manifest. Because it's not an AMP page, we'll also include some custom JavaScript (pwa.js) and some external CSS (style.css), just because we can! Other than that, for the purposes of this example, it doesn't really matter what's in this page. The important bits are shown as follows, while the full file can be found at /ch11/amptopwa/pwa.html:
<!DOCTYPE html><html> <head> ...
Read now
Unlock full access