Code Monkey home page Code Monkey logo

lambda-server-adapter's Introduction

AWS Lambda Server Adapter

A tool to run web servers on AWS Lambda

It allows us to start server before events come in and we keep it running in the background as long as events are coming in. This reduces cold starts and improves performance.

Useful for applications such as NextJS, Graphql or REST servers, Express, Apollo, etc.

Features

  • Starts server before events come in and keeps it running in the background as long as events are coming in.
  • Translates AWS events into HTTP requests.
  • Translates HTTP responses into AWS events.
  • Simple plug-and-play as layer.
  • Small size, no dependencies, as fast as your server.

Usage

AWS Lambda Server Adapter work with native runtimes. It is added in a form of Layer.

NextJS

Lambda functions packaged as Zip package for AWS managed runtimes

Handler configuration

Readiness Check

Once new Lambda is started, it will initialize the runtime via Runtime API. We start server and wait for it to respond to our HTTP calls, once it does, we mark the Lambda as ready and start processing events.

In case server does not start - command fails, HTTP response is not received, etc. - we will log the error and Lambda will die after 10sec.

Configurations

Graceful Shutdown

Acknowledgement

This is a direct fork of AWS Lambda Web Adapter which was re-written and simplified. It's based on AWS's lambda_http.

lambda-server-adapter's People

Contributors

sladg avatar

Watchers

 avatar

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.