Coding the Lambda function

Following the Lambda setup, it's time to code the actual Lambda function. We will be editing the code inline, in the index.js file on the Developer Portal itself, following these steps:

  1. Implement the handling of events in exports.handler.  Our Lambda, in this case, will be handling only a single intent, that isOneShotFetchTemperatureIntent. Since we are implementing a One-Shot Launch, this single intent will launch our skill and fetch the temperature data.

Before we move on to write the functional logic, declare the following variables, which will be used by our functional logic:

var https = require('https');var firebaseHost = "androidwarehousemonitor.firebaseio.com";

firebaseHost is the same URL (it may ...

Get Alexa Skills Projects 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.