Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gcf-webhook

Tosuke11MIT1.0.0

easy and powerful webhook 'middleware'

readme

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: {}
  }
)