1.0.1 • Published 4 years ago

lambda-responses v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
4 years ago

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',
  },
});