hapi-webhooks
v0.0.3
Published
Simple webhooks functionality for Hapi
Downloads
1
Readme
Webhooks plugin for Hapi
Simple webhooks functionality for Hapi.
Usage
Register the plugin to your server
server.register([{
register: require('hapi-webhooks-plugin'),
options: {
auth: 'optional-auth-strategy',
eventName: 'name'
}
}]);
The above exposes a webhook at /webhooks/name
that listens for GET
and POST
requests. It also exposes a server event called webhooks-name
. Use the event to run the business logic part.
server.event('webhooks-name', function(request) {
// Handle things here
};