Skip to content

allanbian1017/lambda-http-utils

Repository files navigation

lambda-http-utils

Build Status View on NPM View on NPM codecov

lambda-http-utils is a utility to make it easy to do parameter checking while developing serverless application like AWS Lambda + API Gateway.

Setup

Install:

npm install lambda-http-utils --save-dev

Example

const lambdaUtils = require('lambda-http-utils');

new lambdaUtils.HttpUtils.Builder(headers, body)
      .withHeaderVal('Content-Type', 'application/json')
      .withBody('some_key')
      .build()
      .check()
      .then((data) => {
        // Do something with parsed data...
      })
      .catch((err) => {
        // Something went wrong
      });

License

MIT. See LICENSE for details.

About

It's a utility to make it easy to do parameter checking

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published