/lambda-nodejs-response-helper

Helper functions to create response objects for AWS Lambda

Primary LanguageJavaScript

Response helpers for AWS Lambda (nodejs)

Helper functions to create response objects for AWS Lambda

Installation

npm install --save lambda-nodejs-response-helper

Usage

'use strict';

const {createJsonResponse} = require('lambda-nodejs-response-helper');

module.exports.hello = async (event) => {
  return createJsonResponse(
    200,
    {
      message: 'Go Serverless v1.0! Your function executed successfully!',
      input: event,
    },
    {
      'X-Custom-Header': 'Foobar'
    }
  );
};