1.0.1 • Published 4 years ago
runlambdas v1.0.1
Local Lambda Server
runlambdas is a tool for running Node.js Lambdas locally.
This is a fork of the Lambda testing server provided with the Jolt Framework adapted to serve as a standalone CLI tool.
Features:
- Hot reloading of functions so you don't need to restart the server.
- Environment variables are made available during function invocation.
- Supports both synchronous and asynchronous Lambdas.
- Functions can be nested to support multi-segment paths (ie:
GET http://localhost:3001/one/two/myLambda).
Installation:
npm i -g runlambdas`Usage:
runlambdas functionFolderName [portNumber]- A
functionFolderNameis provided as a relative path. This tellsrunlambdaswhere to look for Lambda handlers. - Lambda handlers will be loaded based on the request path with the
functionFolderNameas the root.- ie: A request to
http://localhost:3001/one/two/myLambdawill try to invoke the function at the relative path./functionFolderName/one/two/myLambda.js.
- ie: A request to
- Environment variables (if any are present) are loaded from the
.envfile located in the same directory as the Lambda at runtime. - By default, the server will run on port 3001, but an optional
portNumberparameter lets you specify a different port.