serverless-runtime-babel icon indicating copy to clipboard operation
serverless-runtime-babel copied to clipboard

Adds callback parameter to ENV loader

Open barwick opened this issue 7 years ago • 0 comments

Adds a "cb" parameter to the ENV var pre load handler, allowing callbacks to be used: e.g. of the form handler (event, context, cb) => {}.

Had a function looking something like this:

module.exports.handler = (event, context, cb) => {
  console.log(event, context, cb)
  return cb(null, 'Success!');
};

Serverless was returning the error

cb is not a function

Since it was always undefined. I didn't have the ability to pass a callback through the babel transpiled code, so this change adds that functionality.

barwick avatar Jul 14 '16 15:07 barwick