README
Lambda Responses
Simple library to help with lambda responses.
- Note: This tool was build to be used internally but wanted to make it available to others if needed.
- Credit: https://github.com/AnomalyInnovations/serverless-stack-demo-api
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',
},
});