mikestaub / serverless-express

Run your unmodified express app on AWS Lambda via the Serverless framework.
MIT License
151 stars 21 forks source link

Support for binary file #19

Open dod91 opened 5 years ago

dod91 commented 5 years ago

Hi, I'm trying to use serverless-express for sending binary data (application/zip) as response but I'm unable to do it. AWS forum talks about a custom response with isBase64Encoded key on the response but it doesn't seem to be covered on this library. Am I missing something or do you have any example or documentation for it?

Thank you.

mikestaub commented 5 years ago

I think this is out of scope for this plugin. Have you tried using this one? https://github.com/maciejtreder/serverless-apigw-binary

dod91 commented 5 years ago

Hello @mikestaub thank you for your response. Yep I've tried it but didn't work right for me; currently I've solved it by sending a base64 of the file and then doing t he job client side but that's just a workaround for small files.

Still looking for something better :)

mikestaub commented 5 years ago

To be honest, I feel like you should be serving binary files from S3/Cloudfront, not express. This plugin was created for API servers. I think we can make it work for binary responses but I don't have time right now to investigate. I'm happy to work with you on a PR if you want to take this on.