aws-lambda-http-server
v0.2.7
Published
run http server as aws lambda function
Downloads
154
Maintainers
Readme
aws-lambda-http-server
Call your http server stack code using an in memory http listener. No sockets needed.
Should work with any http framework.
Tests include the following http frameworks.
- [x] Express
- [x] Fastify
- [x] Koa
- [x] server-base
server.js
require('http').createServer((req, res) => {
if (req.url === '/hello') return res.end('world')
})
.listen(5000)
aws-lambda.js
exports.proxy = require('aws-lambda-http-server')
require('./server.js')
serverless.yml example
service: test
provider:
name: aws
runtime: nodejs12.x
region: eu-west-1
functions:
proxy:
handler: aws-lambda.proxy
events:
- http:
path: /{proxy+}
method: any
- http:
path: ''
method: any