Skip to content

Instantly share code, notes, and snippets.

@kenng
Created January 22, 2018 03:17
Show Gist options
  • Save kenng/9e72afece4ab9bb725bfdfd42605963f to your computer and use it in GitHub Desktop.
Save kenng/9e72afece4ab9bb725bfdfd42605963f to your computer and use it in GitHub Desktop.
alexa-hello-world
'use strict';
const Alexa = require('alexa-sdk');
const handlers = {
'LaunchRequest': function () {
this.emit('SayHello');
},
'HelloIntent': function () {
this.emit('SayHello');
},
'SayHello': function() {
this.response.speak("Hello, Awesome");
this.emit(':responseReady');
},
'Unhandled': function() {
this.response.speak("Sorry, I have not programmed to understand this yet");
this.emit(':responseReady');
}
};
exports.handler = function (event, context) {
const alexa = Alexa.handler(event, context);
alexa.registerHandlers(handlers);
alexa.execute();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment