1.0.0 • Published 7 years ago

gcf-webhook v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

gcf-webhook

easy and powerful webhook 'middleware'

Example

const webhook = require("gcf-webhook");

// Google Cloud Function(HTTP trigger) entry point
exports.entry = webhook(
  body => {
    return {
      text: body.message
    }
  },
  "https://webhook.example.com",
  // common fields
  {
    channel: "#general"
  },
  // axios options(see https://github.com/axios/axios#request-config)
  {
    headers: {}
  }
)