cherry-webhooks

cherry plugin to listen for webhooks events

Usage no npm install needed!

<script type="module">
  import cherryWebhooks from 'https://cdn.skypack.dev/cherry-webhooks';
</script>

README

cherry-webhooks

config

This config will create a server listening on port 42777 and will produce from: "dockerhub" messages when a "POST /my_dockerhub_hook" request is received.

"webhooks": {
  "host": "0.0.0.0",
  "port": 42777,
  "hooks": [
    [ "dockerhub", "/my_dockerhub_hook" ]
  ]
}

api

Produces "from: <webhook_name>" messages. e.g.

cherry.handle({
  dockerhub: function (message) {
    var repo = message.repository.repo_name;

    cherry.produce({
      to: 'chat',
      body: '[dockerhub] pushed at ' + repo
    });
  }
});