GithubHelp home page GithubHelp logo

sajathajk / aws-serverless-express Goto Github PK

View Code? Open in Web Editor NEW

This project forked from codegenieapp/serverless-express

0.0 1.0 0.0 1.33 MB

Run serverless applications and REST APIs using your existing Node.js application framework, on top of AWS Lambda and Amazon API Gateway

License: Apache License 2.0

JavaScript 100.00%

aws-serverless-express's Introduction

AWS Serverless Express

Join the chat at https://gitter.im/awslabs/aws-serverless-express Build Status npm npm dependencies Status devDependencies Status

Run serverless applications and REST APIs using your existing Node.js application framework, on top of AWS Lambda and Amazon API Gateway. The sample provided allows you to easily build serverless web applications/services and RESTful APIs using the Express framework.

Getting Started

npm install aws-serverless-express
// lambda.js
'use strict'
const awsServerlessExpress = require('aws-serverless-express')
const app = require('./app')
const server = awsServerlessExpress.createServer(app)

exports.handler = (event, context) => { awsServerlessExpress.proxy(server, event, context) }

Package and create your Lambda function, then configure a simple proxy API using Amazon API Gateway and integrate it with your Lambda function.

Quick Start/Example

Want to get up and running quickly? Check out our basic starter example which includes:

Getting the API Gateway event object

This package includes middleware to easily get the event object Lambda receives from API Gateway

const awsServerlessExpressMiddleware = require('aws-serverless-express/middleware')
app.use(awsServerlessExpressMiddleware.eventContext())
app.get('/', (req, res) => {
  res.json(req.apiGateway.event)
})

Is AWS serverless right for my app?

Benefits

Considerations

  • For apps that may not see traffic for several minutes at a time, you could see cold starts
  • Cannot use native libraries (aka Addons) unless you package your app on an EC2 machine running Amazon Linux
  • Stateless only
  • API Gateway has a timeout of 29 seconds, and Lambda has a maximum execution time of 15 minutes.

aws-serverless-express's People

Contributors

brettstack avatar sapessi avatar semantic-release-bot avatar panva avatar dependabot[bot] avatar jeremylevy avatar kahouieong avatar jun711 avatar topisark avatar htchaan avatar y13i avatar gitter-badger avatar nogut0123 avatar ovalba avatar forabi avatar markstos avatar maksimaniskov avatar lcharold avatar autopulated avatar hyandell avatar warsame avatar benjamingill avatar adrai avatar

Watchers

James Cloos 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.