Skip to content

Standalone, minimalistic server and listener for simulating API Gateway Lambda Proxy integration.

Notifications You must be signed in to change notification settings

stawecki/lambda-proxy-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lambda-proxy-server

Standalone, minimalistic server and listener for simulating API Gateway Lambda Proxy integration.

For Node.js Lambdas only.

Note: For local development only. Many API Gateway features are missing.

Features:

  • Compatible with: aws-serverless-express and lambda-api
  • Standalone - run without SAM CLI or Serverless Framework
  • Listener support - bring your own server or attach to router.
  • POST body data support

Usage

Install:

npm install lambda-proxy-server

There are multiple ways in which you can use this module:

  • Create a server script:
const server = require("lambda-proxy-server").createServer({
    handler: require("./path/to/lambda")["methodName"]
});
server.listen(8080, function () {
    console.log("Listening on http://localhost:" + server.address().port + "/");
});
  • Or, use the "run" script:
export LAMBDA_PATH="`pwd`/mylambda/handler"; \
export LAMBDA_FUNC="run"; \
export PROXY_PORT="8907"; \
node ./node_modules/lambda-proxy-server/run

Credits

Based on this gist by Sleavely.

About

Standalone, minimalistic server and listener for simulating API Gateway Lambda Proxy integration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published