Skip to content

Instantly share code, notes, and snippets.

@jwulf
Created October 6, 2015 16:23
Show Gist options
  • Save jwulf/d73318465a2b14f3136a to your computer and use it in GitHub Desktop.
Save jwulf/d73318465a2b14f3136a to your computer and use it in GitHub Desktop.
'use strict';
/**
* AWS Module: Action: Lambda Handler
* "Your lambda functions should be a thin wrapper around your own separate
* modules, to keep your code testable, reusable and AWS independent"
*/
require('jaws-core-js/env');
// Modularized Code
var action = require('./index.js');
// Lambda Handler
module.exports.handler = function(event, context) {
action.run(event, context).then(function(result) {
return context.done(null, result);
}).error(function(error){
return context.done(error, null)
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment