Skip to content

Instantly share code, notes, and snippets.

@primaryobjects
Created August 24, 2016 14:45
Show Gist options
  • Save primaryobjects/24f473d64a1220f2bffadfbb2b44bf94 to your computer and use it in GitHub Desktop.
Save primaryobjects/24f473d64a1220f2bffadfbb2b44bf94 to your computer and use it in GitHub Desktop.
Your first Amazon Alexa skill: Hello World. Running on alexa-app-server.
var alexa = require('alexa-app');
// Create a skill.
var hello = new alexa.app('hello');
// Launch method to run at startup.
hello.launch(function(req,res) {
res.say("Ask me to say hi!");
// Keep session open.
res.shouldEndSession(false);
});
// Create an intent.
hello.intent('hello', {
'slots': {},
'utterances': [ '{to |}{say|speak|tell me} {hi|hello|howdy|hi there|hiya|hi ya|hey|hay|heya}' ]
},
function(req, res) {
res.say('Hello, World!');
res.shouldEndSession(false);
}
);
module.exports = hello;
{
"name": "hello",
"version": "0.0.1",
"main": "index.js",
"dependencies": {
"alexa-app": "*"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment