alexa-js / alexa-app-server

An Alexa app server for alexa-app.
MIT License
401 stars 116 forks source link

Possible fix for #77 #83

Closed benedekh closed 7 years ago

benedekh commented 7 years ago

Hello,

I implemented a possible fix for #77. It makes the application id queryable and replaces the template application id in the queries, when the server is not in production. Some tests are implemented also.

dblock commented 7 years ago

This seems strange. We rely on a request to figure out the application ID and then remember it? I am confused.

benedekh commented 7 years ago

Yes, because the website uses a separate controller which does not have the app.id registered automatically. The app.id in index.js is not accessible from the views/test.ejs.

Maybe I get something wrong with the controller in test.ejs, but is there a better solution for this problem?

UPDATE: Solution is changed completely. The index.js and views/test.ejb files are restored to their original states and the examples are modified instead.

dblock commented 7 years ago

Ok this is a lot easier. Is this what we have to do for all applications? Maybe something should be added in the README of alexa-app?

benedekh commented 7 years ago

I tested the solution for the sample apps and as long as the applicationId was in the package.json or it was set as an alternative value (instead of an empty string), it worked. I didn't test for production (verify=true) tough. But as I remember in production the GET interface (intent simulator) is not available. Correct me please, if I'm wrong.

dblock commented 7 years ago

Merged via https://github.com/alexa-js/alexa-app-server/commit/6924e903e205bf26d795b3a0d7d8021aa6a41b76, thanks!