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,6 +2,10 @@ var Alexa = require ('alexa-sdk');
const config = require ('../config/config'); const config = require ('../config/config');
var databaseHelper = require ('../helpers/database'); var databaseHelper = require ('../helpers/database');
var handlers = {};
module.exports = {
run: function (req, res) {
// Build the context manually, because Amazon Lambda is missing // Build the context manually, because Amazon Lambda is missing
var context = { var context = {
succeed: function (result) { succeed: function (result) {
@@ -14,10 +18,6 @@ var context = {
}, },
}; };
var handlers = {};
module.exports = {
run: function (req, res) {
var alexa = Alexa.handler (req.body, context); var alexa = Alexa.handler (req.body, context);
alexa.appId = config.SKILL_ID; alexa.appId = config.SKILL_ID;
alexa.registerHandlers (handlers); alexa.registerHandlers (handlers);