Angular PWA project with service worker, add to home screen feature and push notification. You must build the application to get full functionality.
#build
use 'npm run build' for build the application.
#start application
Angular - npm run serve
Server - from root 'cd ./server/ && node index.js'
IMPORTANT
use
https://chrome.google.com/webstore/detail/cors-toggle/jioikioepegflmdnbocfhgmpmopmjkim?hl=it
to prevent CORS origin error
#how use server
to fire notification use this settings
e.g.
var settings = {
"async": true,
"crossDomain": true,
"url": "http://localhost:8080/notify", <- your server ip
"method": "POST",
"headers": {
"accept": "application/json, text/plain, /",
"origin": "http://localhost:8081",
"content-type": "application/json",
"referer": "http://localhost:8081/",
"accept-encoding": "gzip, deflate, br",
"accept-language": "it-IT,it;q=0.9,en-US;q=0.8,en;q=0.7",
"auth-secret": "ALL", <- this is the secret code store in server.js
"cache-control": "no-cache",
}
}