huke
A simple webhook module
Install and test
# install from npm npm install huke # run all the tests npm installnpm test
Basic Logic
By subscribing an event with the webhook and providing a url, when the webhook triger the corresponding event, a POST request is send to the binding url.
Quick Usage
const hook = hookhook
Reference
constructor
// create empty hook instanceconst hook0 = // can pass a objectconst hook1 = event1: 'http://localhost/aftertriger' // or pass a function to return the configure objectconst hook2 = { assert return fullObjevents} a: 1 b: 2 events: event1: 'http://localhost/aftertriger'
subscribe
const hook = hook
triger
hook
use
// configure the post request options before send the requesthookhook