lambda-responses

1.0.1 • Public • Published

Lambda Responses

Build Status

Simple library to help with lambda responses.

Success

Call the success function to return the 200 response.

const { success } = require('../utils/responses');
 
return success({
  status: 'success',
  data: {
    message: 'This is a sample message',
  },
});

Failure

Call the failure function to return the 500 response.

const { failure } = require('../utils/responses');
 
return failure({
  status: 'failure',
  data: {
    message: 'This is a sample message',
  },
});

Not Found

Call the notFound function to return the 500 response.

const { notFound } = require('../utils/responses');
 
return notFound({
  status: 'notFound',
  data: {
    message: 'This is a sample message',
  },
});

Package Sidebar

Install

npm i lambda-responses

Weekly Downloads

2

Version

1.0.1

License

ISC

Unpacked Size

5.6 kB

Total Files

8

Last publish

Collaborators

  • coreyshaw