send-webhook

1.0.0 • Public • Published

send-webhook

NPM

const webhook = require('send-webhook');
 
const URLS = [
  'http://example.com/webook_reciever',
  'http://johndoe.com/webhook',
  'http://incoming.com/recieve'
];
 
const payload = {
  // This can be anything you want to send.
  status: true,
  data: {
    message: 'This is a sample web-hook that will be sent via POST.'
  }
};
 
/* 
  You can also do it to a single URL by just putting in a string
  instead of an array.
*/
 
 
webhook(URLS, payload, (error, status) => {
  if(error) console.error(error);
  console.log('Webhooks have been sent.');
});
 
 
 
/*
    URL: http://johndoe.com/webhook
    TYPE: POST
    MIME: application/json
    DATA:
      {
        status: true,
        data: {
          message: 'This is a sample web-hook that will be sent via POST.'
        }
      }
 */

Readme

Keywords

Package Sidebar

Install

npm i send-webhook

Weekly Downloads

0

Version

1.0.0

License

ISC

Last publish

Collaborators

  • ishanmarikar