fix 'res not defined'
This commit is contained in:
@@ -2,22 +2,22 @@ var Alexa = require ('alexa-sdk');
|
||||
const config = require ('../config/config');
|
||||
var databaseHelper = require ('../helpers/database');
|
||||
|
||||
// Build the context manually, because Amazon Lambda is missing
|
||||
var context = {
|
||||
succeed: function (result) {
|
||||
console.log (result);
|
||||
res.json (result);
|
||||
},
|
||||
fail: function (error) {
|
||||
console.log (error);
|
||||
//We could send error json from here
|
||||
},
|
||||
};
|
||||
|
||||
var handlers = {};
|
||||
|
||||
module.exports = {
|
||||
run: function (req, res) {
|
||||
// Build the context manually, because Amazon Lambda is missing
|
||||
var context = {
|
||||
succeed: function (result) {
|
||||
console.log (result);
|
||||
res.json (result);
|
||||
},
|
||||
fail: function (error) {
|
||||
console.log (error);
|
||||
//We could send error json from here
|
||||
},
|
||||
};
|
||||
|
||||
var alexa = Alexa.handler (req.body, context);
|
||||
alexa.appId = config.SKILL_ID;
|
||||
alexa.registerHandlers (handlers);
|
||||
|
||||
Reference in New Issue
Block a user