A service to receive push notification subscriptions from the browser and to dispatch notifications to all subscribed users.
- Send all possible notification options
- Validate notifications schema with joi & request schema
- Improve test coverage
- Manage consistently failing subscription endpoints
This project uses a dotenv (
.env) configuration file to load API keys
- Subscription objects are persisted to
db.json
-
npm i -
npm run devstarts the dev server -
NODE_ENV=test npm run devstarts the dev server with in memory db -
npm run buildcompiles the project to js -
npm run startstartes the compiled (production) server
-
GET
/vapid-keycurl localhost:5000/vapid-key
-
POST
/save-subscriptioncurl -X POST -H "Content-type: application/json" \ --data @samples/save-subscription-payload.json \ localhost:5000/save-subscription -
POST
/notify-allcurl -X POST -H "Content-type: application/json" \ --data @samples/notify-all-payload.json \ localhost:5000/notify-all -
POST
/notifycurl -X POST -H "Content-type: application/json" \ --data @samples/notify-payload.json \ localhost:5000/notify