You won't be able to test this locally by using ng serve. You need to compile using ng build and then use a separate HTTP server (e.g. http-server from npm). Also by default, service workers are enabled only on prod environment so if you really want to test this, there is some tweaking to do. However since prod uses a separate HTTP server, I assume that the following should be sufficient to make this run on prod:
1) migrate DB
2) generate VAPID keys using web-push generate vapid-keys --json, add then to config + also add subject (which should be site URL or mailto, as noted in the documentation comment).
3) build + run it
4) hopefully profit
You won't be able to test this locally by using
ng serve
. You need to compile usingng build
and then use a separate HTTP server (e.g.http-server
from npm). Also by default, service workers are enabled only on prod environment so if you really want to test this, there is some tweaking to do. However since prod uses a separate HTTP server, I assume that the following should be sufficient to make this run on prod: 1) migrate DB 2) generate VAPID keys usingweb-push generate vapid-keys --json
, add then to config + also add subject (which should be site URL or mailto, as noted in the documentation comment). 3) build + run it 4) hopefully profit