probot-serverless-now
Probot Wrapper to run GitHub Apps as Serverless Functions in ZEIT Now
Last updated 3 months ago by tibdex .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install probot-serverless-now 
SYNC missed versions from official npm registry.

npm version build status

Goal

probot-serverless-now is a wrapper around Probot to run your GitHub Apps as Serverless Functions with ZEIT Now.

Usage

  • app.js

    module.exports = app => {
      app.on("issues.opened", async context => {
        // A new issue was opened, what should we do with it?
        context.log(context.payload);
      });
    };
    
  • api/index.js

    const { toLambda } = require("probot-serverless-now");
    
    const applicationFunction = require("../app");
    
    module.exports = toLambda(applicationFunction);
    
  • now.json

    {
      "version": 2,
      "env": {
        "APP_ID": "@my-app-id",
        "PRIVATE_KEY": "@my-app-base64-encoded-private-key",
        "WEBHOOK_SECRET": "@my-app-webhook-secret"
      }
    }
    

Supported Probot Features

  • [x] Logging
  • [x] Sentry integration
  • [x] Webhook signature verification
  • [ ] Loading the private key from the filesystem. The PRIVATE_KEY environment variable should be used instead (possibly base64 encoded).
  • [ ] Custom routing. The only routes are:
    • GET /: typical Probot landing page
    • POST /: webhook handler
  • [ ] Multiple applications running under the same Probot instance. Instead, you should create multiple Now Lambdas. Each lambda should have its own now.json file since they won't share the same APP_ID, PRIVATE_KEY, and WEBHOOK_SECRET environment variables. To do that, you could either use multiple repositories or a mono-repo with Yarn workspaces or Lerna for instance.

Current Tags

  • 2.1.2                                ...           latest (3 months ago)

11 Versions

  • 2.1.2                                ...           3 months ago
  • 2.1.1                                ...           9 months ago
  • 2.1.0                                ...           10 months ago
  • 2.0.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.1                                ...           a year ago
  • 1.0.0                                ...           a year ago
  • 0.2.1                                ...           a year ago
  • 0.2.0                                ...           a year ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |