Skip to content

JamesKyburz/aws-lambda-http-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-lambda-http-server

Call your http server stack code using an in memory http listener. No sockets needed.

js-standard-style build status downloads

Should work with any http framework.

Tests include the following http frameworks.

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

license

Apache License, Version 2.0