0.0.3 • Published 7 years ago

hapi-webhooks v0.0.3

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

Webhooks plugin for Hapi

Build Status

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
};