From ebaa8f3ea545362420f9bacd9e16076cc14f70ab Mon Sep 17 00:00:00 2001 From: Tom Barwick Date: Thu, 14 Jul 2016 16:03:30 +0100 Subject: [PATCH] Adds a parameter to the ENV var pre load handler, allowing callbacks to be used: e.g. of the form handler (event, context, cb) => {} --- lib/RuntimeBabel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/RuntimeBabel.js b/lib/RuntimeBabel.js index 1962a6c..f0f0d62 100644 --- a/lib/RuntimeBabel.js +++ b/lib/RuntimeBabel.js @@ -234,9 +234,9 @@ module.exports = function(S) { process.env[key] = envVars[key]; } - exports.handler = (event, context) => { + exports.handler = (event, context, cb) => { try { - const result = require('./${handlerFile}')['${handlerMethod}'](event, context); + const result = require('./${handlerFile}')['${handlerMethod}'](event, context, cb); if (result && typeof result.then == 'function') { result.then(context.succeed).catch(context.fail);