For convenience, we have a demo project to run for exploring the service worker
and the library. We've bound a few npm
scripts that can be run to manage the demo.
While on installation, the demo will also be installed. However if you need to reinstall for any reason, you can run:
npm run demo:install
Then build the demo project by running:
npm run demo:build
To start the server to run locally:
npm run demo:start
There is a dev mode available for auto-updating on code change of the library or demo. To run in this mode:
npm run dev
If you plan on experimenting with the demo app, this mode is a convenience to allow you to see changes quickly. One thing to note: due to the service worker caching, we would need to manage the browser and use dev tools to make sure updates are received, this can be a common point of confusion.
- The demo will run on
http://localhost:3030
to avoid any disruptions or interference on port3000
. - Web Push will require configuration if you are behind a proxy, or it will most likely fail. Solutions welcome.