UNPKG

bugsnag-notification-plugins

Version:

Notification plugins (chat and issue tracking integrations) for Bugsnag.

21 lines (16 loc) 500 B
NotificationPlugin = require "../../notification-plugin" class Webhook extends NotificationPlugin @receiveEvent: (config, event, callback) -> payload = JSON.stringify(event).replace(/\./g,".") # Send the request to the url @request .post(config.url) .timeout(4000) .type('json') .send(payload) .on "error", (err) -> callback(err) .end (res) -> return callback(res.error) if res.error callback() module.exports = Webhook