0.2.4 • Published 3 years ago

@honestdoor/lambda-utils v0.2.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

@honestdoor/lambda-utils

Collection of helpful utilities around working with lambda functions

Response Builder

The Responder is meant to make api gateway responses easier to write and manage

Example Usage:

import { Responder } from '@honestdoor/lambda-utils'

const res = new Responder({
    // Default response variables
    headers: {
        "Access-Control-Allow-Origin": "locahost:3000"
    },
    statusCode: 400
})

...

const response =  res.status(200).json({ success: true })

...

console.log(response)

Output:

{
  "headers": {
     "Access-Control-Allow-Origin": "locahost:3000"
  },
  "statusCode": 200,
  "body": "{ success: true }"
}

Error Example:

res.status(400).error("Something went terribly wrong!")
0.2.4

3 years ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

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

0.0.0

3 years ago