Open jfaraklit opened 6 years ago
@ajshukury a workaround (with a big side effect)
create a separate project JUST for the pdf generating endpoint, then:
adding */*
to types will work for PDF.
If you have other functions in the same project: Your other functions will be affected as everything will be treated as binary.
So if you use this workaround, create a separate Serverless.yml for it (in order to create a separate API Gateway)
Something else you should know: once you publish a function with */*
you cannot undo it, meaning even if you switch back to application/pdf your other normal functions will still be affected. I have also tried manually editing the API gateway binary MIME types in the AWS Console, it cannot be deleted.
adding / to types will work for PDF.
If you have other functions in the same project: Your other functions will be affected as everything will be treated as binary.
it's 2021... Has anyone found a better way of doing this? adding */*
to deal with serving PDF content, still massively breaks any other functions within a serveless.yml file
split pdf function into its own serverless project.
On Wed, May 5, 2021 at 11:01 AM JaredAAT @.***> wrote:
adding / to types will work for PDF.
If you have other functions in the same project: Your other functions will be affected as everything will be treated as binary.
it's 2021... Has anyone found a better way of doing this? adding / to deal with serving PDF content, still massively breaks any other functions within a serveless.yml file
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/maciejtreder/serverless-apigw-binary/issues/48#issuecomment-832895070, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAMM2WBAXMSCU7S3DFC6YL3TMGBW7ANCNFSM4F6O5MFQ .
When trying to get PDF, the PDF is coming blank. Tried adding 'application/pdf' in the list of mime types. Any thoughts? Html and CSS and images can be served.