GithubHelp home page GithubHelp logo

jakebolam / serverless-lambda Goto Github PK

View Code? Open in Web Editor NEW

This project forked from probot/adapter-aws-lambda-serverless

0.0 1.0 0.0 120 KB

An extension for running Probot on Lambda

JavaScript 100.00%

serverless-lambda's Introduction

AWS Lambda Extension for Probot

A Probot extension to make it easier to run your Probot Apps in AWS Lambda.

Usage

$ npm install @probot/serverless-lambda
// handler.js
const { serverless } = require('@probot/serverless-lambda')
const appFn = require('./')
module.exports.probot = serverless(appFn)

Configuration

This package moves the functionality of probot run into a handler suitable for usage on AWS Lambda + API Gateway. Follow the documentation on Environment Configuration to setup your app's environment variables. You can add these to .env, but for security reasons you may want to use the AWS CLI or Serverless Framework to set Environment Variables for the function so you don't have to include any secrets in the deployed package.

For the private key, since AWS environment variables cannot be multiline strings, you could Base64 encode the .pem file you get from the GitHub App or use KMS to encrypt and store the key.

Differences from probot run

Local Development

Since Lambda functions do not start a normal node process, the best way we've found to test this out locally is to use serverless-offline. This plugin for the serverless framework emulates AWS Lambda and API Gateway on your local machine, allowing you to continue working from https://localhost:3000/probot before deploying your function to AWS.

Long running tasks

Some Probot Apps that depend on long running processes or intervals will not work with this extension. This is due to the inherent architecture of serverless functions, which are designed to respond to events and stop running as quickly as possible. For longer running apps we recommend using other deployment options.

Only responds to Webhooks from GitHub

This extension is designed primarily for receiving webhooks from GitHub and responding back as a GitHub App. If you are using HTTP Routes in your app to serve additional pages, you should take a look at serverless-http, which can be used with Probot's express server by wrapping probot.server.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.