fix 'res not defined'

This commit is contained in:
GotPPay
2018-01-18 21:43:25 +01:00
parent 68287d49ff
commit 48badce0f0

View File

@@ -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);