githubbot-connect
v0.1.0
Published
githubbot plugin that creates a connect middleware function to route github webhook event payloads to githubbot handlers.
Downloads
4
Maintainers
Readme
githubbot-connect
githubbot plugin that creates a connect middleware function to route github webhook event payloads to githubbot handlers.
Install
Install with npm
$ npm i githubbot-connect --save
Usage
var githubbotConnect = require('githubbot-connect');
API
.githubbot-connect
githubbot plugin that adds a .middleware
method to githubbot bots that enables creating connect/express middleware functions to handle github webhook event payloads.
Params
options
{Object}: Options to configure the plugin.returns
{Function}: plugin function to pass to.use
Example
bot.use(githubbotConnect(options));
middleware
Create a middleware function suited to pass to a connect/express route. Middleware function will inspect the request headers to determine which github webhook event should be handled.
Params
opts
{Object}: Options to configure how events should be handled.opts.send
{Boolean}: Whentrue
, the results of handling the payload will automatically be sent usingres.json()
. Defaults tofalse
.returns
{Function}: Middleware function for use in connect/express routes.
Example
app.post('/webhooks', bot.middleware(options));
Related projects
- connect: High performance middleware framework | homepage
- express: Fast, unopinionated, minimalist web framework | homepage
- githubbot: Starting point for registering event handlers and handling payloads coming from github webhooks. Allows usage… more | homepage
Running tests
Install dev dependencies:
$ npm i -d && npm test
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Author
Brian Woodward
License
Copyright © 2015 Brian Woodward Released under the MIT license.
This file was generated by verb on December 23, 2015.