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.
require('http').createServer((req, res) => {
if (req.url === '/hello') return res.end('world')
})
.listen(5000)
exports.proxy = require('aws-lambda-http-server')
require('./server.js')
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