1.0.1 • Published 7 years ago
lambda-serve v1.0.1
lambda-serve
Use koa or express on lambda! This is just a simple wrapper around aws-serverless-express
Installation
npm install lambda-serve
Koa example
const Serve = require('lambda-serve')
const koa = require('koa')
const app = koa()
/**
* Add proxy support
*/
app.proxy = true
/**
* Run
*/
exports.default = Serve(app.callback())
/**
* Respond to requests
*/
app.use(function * () {
this.body = this.ip
})
Setup
Follow https://github.com/awslabs/aws-serverless-express#steps-for-running-the-example to get started.