alexa-js / alexa-app

A framework for Alexa (Amazon Echo) apps using Node.js
https://www.youtube.com/watch?v=pzM4jv7k7Rg
MIT License
1.03k stars 212 forks source link

breaking out request/response handling into standalone modules #228

Open mreinstein opened 7 years ago

mreinstein commented 7 years ago

To me, the biggest value that alexa-app provides is it has a small and reasonable encapsulation of parsing alexa requests, and formulating alexa compatible json responses.

I'm wondering if it makes sense to break these out into 2 small, very specific modules:

alexa-request - parses an http request body from alexa and populates a simple javascript object alexa-response - builds an http response object that can be returned to/consumed by amazon alexa

Ideally both of these modules would be absolute minimal, and just follow the alexa documentation for creating/consuming alexa requests/responses.

I haven't looked around at other alexa modules for skill presentation, but I've run into several people that don't even want to use express, let alone alexa-app for building skills, and I suspect breaking these out means people could use the same robust core alexa formatting modules across the whole ecosystem.

mreinstein commented 7 years ago

I just noticed that Cameron already has published modules for both of these, with the same names. They look pretty good! It might be worth standardizing on these.

@cameronhunter I noticed that neither of those npm modules have source code links, and they aren't in your personal github repo. Where's the source hosted? Can these be linked via package.json please?

cameronhunter commented 7 years ago

Sure thing, I'll add the repository field to package.json. They're on GitHub in a monorepo of Alexa packages: https://github.com/cameronhunter/alexa

On Mon, Apr 17, 2017, 16:50 Mike Reinstein notifications@github.com wrote:

I just noticed that Cameron already has published modules for both of these, with the same names. They look pretty good! It might be worth standardizing on these.

@cameronhunter https://github.com/cameronhunter I noticed that neither of those npm modules have source code links, and they aren't in your personal github repo. Where's the source hosted? Can these be linked via package.json please?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alexa-js/alexa-app/issues/228#issuecomment-294629206, or mute the thread https://github.com/notifications/unsubscribe-auth/AAPDBh58faHq1I8_roJHeEO7YLa4iBXMks5rw_rBgaJpZM4M_slg .

dblock commented 7 years ago

I'd appreciate more separation of concerns and the code that @cameronhunter linked looks good. I wouldn't mind seeing alexa-app gutted in favor of these, either by bringing that code here or taking a dependency.

Related, as always this org is happy to "host" whatever alexa projects to reduce bus factor and make things discoverable.