0.3.0 • Published 1 year ago

lambda-dev-server v0.3.0

Weekly downloads
-
License
CC0-1.0
Repository
github
Last release
1 year ago

lambda-dev-server

Run Lambda Functions on your Machine

features

  • no third-party dependencies
  • configure through CLI or environmental variables
  • automatically uses most recent version of handler
  • gracefully handler errors

install

npm install lambda-dev-server

usage

in JavaScript

const { serve } = require("lambda-dev-server");

const { port } = serve({
  // you can also directly pass in the handler function
  handler: "./test-function/handler.js",

  cors: true, // enable cross-origin resource sharing
  debug: true,
  env: { AWS_REGION: "us-east-1" }, // environment object or absolute path to .env file
  max: 100, // maximum number of function requests served
  port: 8888,

  // optional
  // default is true
  // if unset or set to true, it will load the most recent version of the handler
  // on each request clearing any in-memory cache
  reload: false,

  root: "./project"
});

in terminal

lambda-dev-server --cors=true --debug=true --env=$PWD/.env --handler=./dist/index.js --max=99 --port=8888 --reload=false --root=$PWD/project

invoking lambda function

Simply go to your favorite web browser and navigate to localhost:8080 (or localhost:{port}). Refreshing the page will re-load and re-run the lambda function.

0.3.0

1 year ago

0.1.0

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago