I'm learning javascript and the basics of building an Alexa Skill. Amazon provided a simple HelloWorld Alexa Skill found here: https://github.com/amzn/alexa-skills-kit-js/blob/master/samples/helloWorld/src/index.js
I have two questions about this function.
// Create the handler that responds to the Alexa Request.
exports.handler = function (event, context) {
// Create an instance of the HelloWorld skill.
var helloWorld = new HelloWorld();
helloWorld.execute(event, context);
};
- Is this where the execution of the code starts when a user launches an Alexa Skill? It seems to me that this is the portion of the code that creates a HelloWorld object and starts the intent the user wants.
- Is this portion executed every time a user calls an intent? For example, if I asked Alexa "help" twice in this Alexa Skill, would this block of code be called twice? I'm coming from Java where there was a main method and still getting a grasp of javascript.