Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #52, #21 and #35 #64

Merged
merged 5 commits into from
Feb 5, 2017
Merged

Fix #52, #21 and #35 #64

merged 5 commits into from
Feb 5, 2017

Conversation

dblock
Copy link
Collaborator

@dblock dblock commented Feb 3, 2017

@mreinstein correctly calls that #54 fixes #52, #21 and partially #35. What this does is use alexa-app's express method instead of cooking our own, plus a test that right now would hang on master and no longer hangs in this branch.

Replaces #56 on top of #60.

This is dependent on alexa-js/alexa-app#150, I didn't find a better way to get ?utterances, ?schema and preRequest and postRequest support without moving this logic upstream to alexa-app.

Copy link
Collaborator

@rickwargo rickwargo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does indeed fix #21 (it was not working prior to this without a different fix). Also confirmed http/https on custom ports are working as expected.

Looks like test.ejs, schema and utterances are working, too, using GET.

@dblock
Copy link
Collaborator Author

dblock commented Feb 3, 2017

Thanks for checking it out @rickwargo. I'll wait for @tejashah88 to do a code review of this and the upstream PR and merge. We should get things sorted out with a release next. Do you have anything blocking and not working after this?

@rickwargo
Copy link
Collaborator

@dblock on the surface it appears all good, but haven't had the time to dig under the covers. i'll have more time tomorrow.

index.js Outdated

// TODO: change this to make sure it doesn't affect other non-Alexa services/apps
// Issue #35: https://github.com/alexa-js/alexa-app-server/issues/35
self.express.use(bodyParser.urlencoded({ extended: true }));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to this comment in #18, shouldn't it be this:

self.express.use("/alexa", bodyParser.urlencoded({ extended: true }));

#35 stated that "there are many express routes added which don't use urlencoded forms". So logically, one would want to only bind with Alexa-based routes.

Copy link
Collaborator Author

@dblock dblock Feb 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but that issue is still open, I didn't get a chance to write a test for that and fix it (and I definitely don't want to change it here without a corresponding test). There were tabs->spaces changes here so it looks like this code has changed, but it has actually not. You can look at the diff without spaces, https://github.com/alexa-js/alexa-app-server/pull/64/files?w=1

@dblock dblock mentioned this pull request Feb 4, 2017
@dblock dblock changed the title Fix #52, #21, and partially solves #35 Fix #52, #21 and #35 Feb 5, 2017
@dblock
Copy link
Collaborator Author

dblock commented Feb 5, 2017

I've updated this with a fix for #35. Now that we're mounting body-parser inside alexa-app, we can just remove it from alexa-app-server. See alexa-js/alexa-app#155 for details.

@tejashah88 this is ready for you to merge

@@ -19,7 +19,7 @@
},
"license": "MIT",
"dependencies": {
"alexa-app": "^2.4.0",
"alexa-app": "alexa-js/alexa-app",
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we've released 2.4.0 I'll change this and make a release of alexa-app-server.

Copy link
Member

@tejashah88 tejashah88 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look good so far. I'll wait for @rickwargo to say more about this before merging.

@rickwargo
Copy link
Collaborator

Sorry, @tejashah88, didn't get a chance to review today. I will have time in the morning.

@rickwargo
Copy link
Collaborator

Looks good, however bodyParser.urlencoded() is now removed via alexa-app#152 - found this testing a form post hosted in alexa-app-server. I believe this was previously handled - does it need to be handled or should it be called out in the README?

@rickwargo
Copy link
Collaborator

One (simple) formatting suggestion is to remove trailing slashes from the normalizedRoot in self.loadapps(). The comments have an example where the server root ends with a slash and if included, the message says, "loaded app [hello_world] at endpoint: /alexa//hello_world."

@dblock
Copy link
Collaborator Author

dblock commented Feb 5, 2017

I think the urlencoded bodyparser is not the business of these libraries. I've added a note to UPGRADING in alexa-js/alexa-app#158.

Opened #68 for the slashes thing, it's cosmetic unless I'm missing something.

@dblock
Copy link
Collaborator Author

dblock commented Feb 5, 2017

Looks like everyone is happy with this, merging. Thanks for your help!

@dblock dblock merged commit 85ef58d into alexa-js:master Feb 5, 2017
@dblock dblock deleted the a-little-closer-56 branch February 5, 2017 13:46
@rickwargo
Copy link
Collaborator

@dblock cosmetic only. I'm fine either way on the urlencoded bodyparser - #64 breaks functionality so it needs to be noted. Could be I was the only one using that.

@dblock
Copy link
Collaborator Author

dblock commented Feb 5, 2017

Yep @rickwargo, I documented this change in UPGRADING, both here (#69) and alexa-app (alexa-js/alexa-app#158).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

setting "verify: true" is causing alexa app to timeout from echo devices
4 participants