You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Initialize WebHooks module.
var WebHooks = require('node-webhooks')
// Initialize webhooks module from on-disk database
var webHooks = new WebHooks({
db: './webHooksDB.json', // json file that store webhook URLs
httpSuccessCodes: [200, 201, 202, 203, 204], //optional success http status codes
})
webHooks.add('test', 'http://127.0.0.1:9000/test').then(function(){
// done
}).catch(function(err){
console.log(err)
})
var emitter = webHooks.getEmitter()
emitter.on('*.success', function (shortname, statusCode, body) {
console.log('Success on trigger webHook' + shortname + 'with status code', statusCode, 'and body', body)
})
emitter.on('*.failure', function (shortname, statusCode, body) {
console.log(shortname)
console.error('Error on trigger webHook' + shortname + 'with status code', statusCode, 'and body', body)
})`
While trigger the webhook "let wb = webHooks.trigger('test', {data: 123456}, {header: 'header'})" got this error Error on trigger webHookshortname1with status code null and body null
The text was updated successfully, but these errors were encountered:
While trigger the webhook "let wb = webHooks.trigger('test', {data: 123456}, {header: 'header'})" got this error Error on trigger webHookshortname1with status code null and body null
The text was updated successfully, but these errors were encountered: