rdlabo-team/serverless-nestjs

Reintroduce async/await to handler

Thomas-X opened this issue · 1 comments

Saw the async handler was removed due to an issue with aws-serverless-express. It's an issue related to the fact that async handlers return a promise, which the serverless package tries to proxy, resulting in malformed response back to API Gateway

I.e doing something like the following in your handler should fix the issue you were facing:

return awsServerlessExpress.proxy(server, event, context, 'PROMISE').promise;

Related commit 84db18e

Thanks for Issue. I fixed it. Please check!