alexa-js / alexa-verifier-middleware

An express middleware that verifies HTTP requests sent to an Alexa skill are sent from Amazon.
MIT License
31 stars 6 forks source link

Doesn't work with Restify - for want of just a couple of tweaks #23

Closed bassmanitram closed 7 years ago

bassmanitram commented 7 years ago

I accept that this is a weakness in Restify, but their response.status method is a getter/setter, not a fluent method.

Consequently, lines 12 and 40 in index.js - where the status and response are set fluently - crash when used with Restify instead of Express

This is all that is stopping this module from being usable in both Express and Restify (I've tested the necessary tweaks).

So, any chance of tweaking for, again, what is certainly a design weakness in Restify, but which is going to be much easier to accommodate with the above changes than trying to get Restify to change a core design decision and break every Restify user?

dblock commented 7 years ago

Feel free to contribute fixes, tests and documentation for using the middleware with Restify.

mreinstein commented 7 years ago

@bassmanitram I think it would be better to actually create a module specifically for alexa verifying that works with restify. This module was designed specifically as an express middleware. Alternatively, restify could update it's API to match connect/express (which is what it claims is a goal anyway.)