1.0.21-d1fa702 • Published 4 years ago

@koeroesi86/node-lambda-invoke v1.0.21-d1fa702

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Node Lambda invoke Build status

A library that can be easily used for AWS lambda functions locally

Dependencies

Usage

yarn add @koeroesi86/node-lambda-invoke

Or with npm

npm i --save @koeroesi86/node-lambda-invoke

Example

const http = require('http');
const { httpMiddleware } = require('@koeroesi86/node-lambda-invoke');

const host = 'localhost';
const port = 8080;

const lambdaPath = './pathOfLambda.js';
const handlerKey = 'handler';
const logger = console.log;
const limit = 100; // overall limit ox running lambdas

http
  .createServer(httpMiddleware({
    lambdaPath,
    handlerKey,
    logger,
    limit,
    communication: {
      // file|ipc|custom --- When 'custom' used, path is needed
      type: 'ipc',
    }
  }))
  .listen(
    { host, port, exclusive: true },
    () => console.log(`Server running on http://${host}:${port}`)
  );

Running locally

yarn start

Configuration

Coming soon, currently a basic .env way is available...