dougmoscrop / serverless-http

Use your existing middleware framework (e.g. Express, Koa) in AWS Lambda 🎉
Other
1.72k stars 165 forks source link

Broken with Restify? #154

Open daniel-ac-martin opened 4 years ago

daniel-ac-martin commented 4 years ago

I had problems running this library with the current version of Restify. I received the 'unsupported framework' error.

I seem to have been able to get it to work with the following hack:

httpd.handler = httpd._onRequest;
handler = serverless(httpd);

I wonder whether _onRequest should be checked for in getFramework?

(Another candidate might be _runRoute.)

dougmoscrop commented 4 years ago

That makes sense, yeah, the framework detection is pretty hacky and in some cases leans more on internal details (subject to change - like this seems to be)

daniel-ac-martin commented 4 years ago

@dougmoscrop: Thanks for reviewing that PR.

Would you mind publishing when you get a chance? - That way, I can remove that workaround from my code.