Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including aws-serverless-express with all npm packages installed. Try it out:

var awsServerlessExpress = require("aws-serverless-express")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

aws-serverless-express v3.3.8

This library enables you to utilize AWS Lambda and Amazon API Gateway to respond to web and API requests using your existing Node.js application framework.

AWS Serverless Express

Join the chat at 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.get('/', (req, res) => {

Is AWS serverless right for my app?



  • 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.
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free