Serverless framework plugin to configure binary support for API Gateway endpoints
npm install serverless-apigwy-binaryFunctionality as provided by plugin is available in Serverless Framework natively (since v1.59.0)
contentHandling on http event responses can be confgured simply as:
``yaml`
functions:
someFunction:
events:
- http:
....
response:
contentHandling: CONVERT_TO_BINARY
Serverless framework plugin to configure Binary responses in API Gateway
Original code from codebox
Install to your Serverless project via npm
`bash`
$ npm install --save serverless-apigwy-binary
Add the plugin to your serverless.yml
`yamlserverless.yml
plugins:
- serverless-apigwy-binary
`
Add the property contentHandling: CONVERT_TO_BINARY to an HTTP event
`yamlserverless.yml
functions:
hello:
handler: handler.hello
events:
- http:
integration: lambda
path: hello
method: get
contentHandling: CONVERT_TO_BINARY
``