Hapi server app for creating and distributing push notifications
npm install
bower install
gulp build
gulp syncDb
Start the hapi server and set up watches on templates, js and css
gulp watch
App config is controlled via the node-config module.
To set push credentials, create a local.json file under the config dir and override the CREDENTIALS setting.
Alternately, you can use:
By default, the app exposes all API endpoints and the web UI. This would allow a 3rd party to send a correctly crafted notification object to the server and have it go to all subscribers.
You should ensure that wherever the app is running it either:
- has an authentication layer
- is running behind another server, nginx / apache etc., that restricts access to the relevant endpoints
gulp test
POST
/api/1/notifications - adds a new notification to the database and publishes it to all attached channelsGET
/api/1/notification/{notificationId} - fetches the notification matching notificationIdPOST
/api/1/notifications/search - fetches all notifications matching the supplied search object
See the schema object for details of the object structure these endpoints accept
POST
/api/1/subscriptions - adds a new subscription and subscribes that user to notifications from their preferred channel(s)DELETE
/api/1/subscriptions/{deviceId} - deletes a subscription
See the schema object for details of the object structure these endpoints accept
POST
/api/1/errors - Logs a client-side error to the server logs
See the schema object for details of the object structure these endpoints accept
See the www/README.md for details