From 84c11f1b2fa9b9aa8404446d78d3bbbc20c04b61 Mon Sep 17 00:00:00 2001 From: Bilal Date: Mon, 8 Jan 2018 21:13:23 +0000 Subject: [PATCH] Keep session open --- backend/config.js | 4 ++-- backend/express.js | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backend/config.js b/backend/config.js index 3edee7d..5c41336 100644 --- a/backend/config.js +++ b/backend/config.js @@ -8,8 +8,8 @@ config.REFRESH_TOKEN = 'Atzr|IwEBICA3kDhfSJxlwvnQp9AD1o115AC_KBbFd5GBg8oN_QHWn2o config.TOKEN_EXPIRES_IN = 1515100500; config.SKILL_ID = 'amzn1.ask.skill.efbf0564-a732-4ba9-958f-57939138adae'; -//config.SKILL_DB_ID = '5a5016e775becaef2015da10'; //for server -config.SKILL_DB_ID = '5a232fb86ce046c749739455'; //for local +config.SKILL_DB_ID = '5a5016e775becaef2015da10'; //for server +//config.SKILL_DB_ID = '5a232fb86ce046c749739455'; //for local config.CLIENT_ID = 'amzn1.application-oa2-client.c748ca56ded04a95b236979898585ff7'; config.CLIENT_SECRET = '6dea8125cecd049d3c4cff7bb5bdfd3ff17bc6fed246c4c8f6b519d9ed08d0b3'; diff --git a/backend/express.js b/backend/express.js index 3f027c2..4177ee6 100644 --- a/backend/express.js +++ b/backend/express.js @@ -46,12 +46,12 @@ var updateIntentsJSON = function () { utterances: intent.questions, }, function (request, response) { - return response.say (intent.answer); + return response.say (intent.answer).shouldEndSession(false); } ); }); alexaApp.launch ((request, response) => { - return response.say (skill.invocationAnswer); + return response.say (skill.invocationAnswer).shouldEndSession(false); }); }) .catch (err => { @@ -94,10 +94,12 @@ router.post ('/updateSkill/:id', async (req, res, next) => { let id = req.params.id; let skill = req.body; delete skill._id; + console.log('id = ' + id); if (id !== '-1') { amazonHelper .updateSkill (skill) .then (amazonResult => { + console.log('amazon result : ' + amazonResult); if (amazonResult === 200 || amazonResult === 202) { //Skill uploaded, it's ok to update databaseI databaseHelper