Skip to content
This repository has been archived by the owner on Feb 12, 2020. It is now read-only.

Latest commit

 

History

History
25 lines (23 loc) · 435 Bytes

README.md

File metadata and controls

25 lines (23 loc) · 435 Bytes

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