lib/endpoint/res.js
function send(statusCode, body) {

  if (body) {
    body = JSON.stringify(body);
  }

  return {
    statusCode,
    body
  };
}
function send(statusCode, body) {

  if (body) {
    body = JSON.stringify(body);
  }

  return {
    statusCode,
    body
  };
}
function send ( statusCode , body ) { if ( body ) { body = JSON . stringify ( body ) ; } return { statusCode , body } ; }
Formats statusCode, body to be sent as a HTTP response back to Api Gateway.
The body parameter can be a a String, an object, or an Array.
@name send
@function
@param {number} statusCode Http Response code - https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
@param {string|Object|Object[]} body string, Object, or Array
Formats statusCode body to be sent as a HTTP response back to Api Gateway . The body parameter can be a a String an object or an Array .