To get a better understanding of "offline", please follow this link. There are two main reason why you should build your applications offline first:
- availability : a web app still works and can be accessed by users even without an internet connection.
- peformance : because web content is available offline, there is no need to make a network request and content is presented to users more quickly.
Make sure you have installed http-server globally and then run it in this directory:
http-server -p 18081
Open your browser and access http://localhost:18081 (Note: http-server can be configured to start on a different port)
Online
First open in browser using localhost, and let service worker install.
Offline
Google Chrome developer tools has a feature to simulate a dead network. Open developer tools -> network -> and check the setting labeled "Offline". Refresh the page.