serverless-apigwy-binary | Serverless framework plugin to configure Binary responses | REST library
kandi X-RAY | serverless-apigwy-binary Summary
kandi X-RAY | serverless-apigwy-binary Summary
Serverless framework plugin to configure Binary responses in API Gateway
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of serverless-apigwy-binary
serverless-apigwy-binary Key Features
serverless-apigwy-binary Examples and Code Snippets
Community Discussions
Trending Discussions on serverless-apigwy-binary
QUESTION
Anyone know how to set a websocket's content handling strategy to binary in the serverless framework?
I have a websocket defined as follows:
...ANSWER
Answered 2021-Feb-14 at 17:54I "solved" this by base64 encoding my binary data and using the $default
handler, which allows arbitrary datatypes
QUESTION
I'm trying to upload images to an S3 bucket using the serverless framework. When I call the endpoint after deploy the code fails with an Access Denied error. What am I doing wrong?
The error using 'serverless logs -f fileDownload':
...ANSWER
Answered 2020-May-11 at 12:40To upload to bucket, I'm just using this way:
QUESTION
I'm writing an API for internal use, and for the first time I'm using the serverless framework. I'm writing a Lambda function in Node.js, and using the AWS API Gateway to connect to it.
In some cases I want to return a custom error message, and I'm trying to write a function that would allow me to do that. Right now, any time the Lambda process fails, I get a standard message from the API. In the code, if I try to kill the process using process.exit(1)
, I get a generic error, even if I've already returned an error using callback()
:
ANSWER
Answered 2018-Nov-17 at 15:01Your lambda function needs to return success in order for APIgateway to detect your response. Try this:
QUESTION
I have a serverless app which uploads files to s3 (via POST request) and serves them (via GET request)
I am using serverless-apigw-binary
and serverless-apigwy-binary
plugins to allow me to return binary data in the form of an image. In order to allow the URL to work with browsers, I have to set the binary types to */*
.
In order to upload an image the POST endpoint takes a body like { "base64": "..." }. However with this configuration the entire body is coming through as a base64 encoded string. How can I prevent the request body with application/json
being transformed?
See serverless.yml
below:
ANSWER
Answered 2018-Sep-26 at 18:44You have two options:
Stop using
*/*
as the type selector. This is treating everything as binary, and therefore base64 encoding everything. Unfortunately, you can't express an exception to the rule, only things that follow the rule. You could add a comprehensive list of the types that must be treated as binary, but that sounds fragile to me.Just accept the base64 JSON and de-base64 it on the other side. This seems easiest. You're using node, it looks like, and there are ample tutorials about this. Sure, it adds some steps and a bit of bloat, but let's be honest, you're using API Gateway and Lambda (which are nice tools, but...) so clearly performance doesn't have to be tuned to the millisecond here.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install serverless-apigwy-binary
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page