Why to separate the Lambda handler from the core logic

0 votes

So, I've recently started experimenting with the lambda function and I read it somewhere that I need to separate the Lambda handler (entry point) from the core logic. can you explain why?

May 20, 2019 in AWS by Yamini
2,092 views

1 answer to this question.

0 votes

Separating the Lambda handler (entry point) from the core logic allows you to make a more unit-testable function. In Node.js this may look like:

exports.myHandler = function(event, context, callback) {
var foo = event.foo;
var bar = event.bar;
var result = MyLambdaFunction (foo, bar);
callback(null, result);
}
function MyLambdaFunction (foo, bar) {
// MyLambdaFunction logic here
}
answered May 20, 2019 by Tushar

Related Questions In AWS

0 votes
1 answer

How to invoke the AWS lambda function from Java code

There are 2 methods in this class which should ...READ MORE

answered Feb 19, 2019 in AWS by Archana
• 5,640 points
6,016 views
+1 vote
2 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP