Defining the lambda function

Now that the voice model is trained and we have a public URL to access the API engine, we are going to write the required service to respond to the user's interactions.

When a user goes, Alexa, ask smarty app the weather report, Alexa will make a request to the AWS lambda function and the lambda function will call the API engine for appropriate activity.

Quoting from AWS: https://aws.amazon.com/lambda/details/

The AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources for you. You can use AWS Lambda to extend other AWS services with custom logic, or create your own back-end services that operate at AWS scale, performance, ...

Get Practical Internet of Things with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.