Skip to content

Commit

Permalink
added intent data
Browse files Browse the repository at this point in the history
  • Loading branch information
tbtz committed Dec 2, 2017
1 parent c8ef63e commit bc545e2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,26 @@ function getMeals(planHtml) {
return meals;
}

function generateResponse(meals) {
return {
"version": "1.0",
"response": {
"outputSpeech": {
"type": "PlainText",
"text": "Plain text string to speak",
"ssml": "<speak>" + meals.join(', ') + "</speak>"
}
}
}

}

app.post('/', function (req, res) {
let date = req.body.date;
let date = req.body.request.intent.slots['Day'].value;
return getPlan(date)
.then(getMeals)
.then(meals => {
res.send(meals);
res.send(generateResponse(meals));
})
.catch(function (err) {
res.status(500).send(err)
Expand Down

0 comments on commit bc545e2

Please sign in to comment.