I'm getting started with nodejs and the serverless framwork. in some of the examples i've seen and even used the following code (from https://www.serverless.com/framework/docs/providers/aws/guide/functions/):
// handler.js
module.exports.functionOne = function(event, context, callback) {};
2 questions:
1) does module.exports have anything to do with the common node method of making functions available to other nodules?
2)What is the context they are referring to here? based on http://ryanmorr.com/understanding-scope-and-context-in-javascript/
I see:
Every function invocation has both a scope and a context associated with it. Fundamentally, scope is function-based while context is object-based. In other words, scope pertains to the variable access of a function when it is invoked and is unique to each invocation. Context is always the value of the this keyword which is a reference to the object that “owns” the currently executing code.
Does this apply here?