eagletmt / aws-lambda-rie-gateway Goto Github PK
View Code? Open in Web Editor NEWConvert HTTP request to API Gateway payload for aws-lambda-rie
License: MIT License
Convert HTTP request to API Gateway payload for aws-lambda-rie
License: MIT License
Thanks for develop this bridge.
Could you publish this project as a Docker image and allow to customize the RIE endpoint value (Env var or CMD argument)
Thanks again
Hello!
I have a lambda that is served using RIE, which was set up using the following docker-compose.yaml
:
version: '2.4'
services:
# https://github.com/eagletmt/aws-lambda-rie-gateway
apigw:
image: public.ecr.aws/eagletmt/aws-lambda-rie-gateway
environment:
TARGET_URL: http://app:8080
ports:
- 8080:8080
app:
image: drift_checker
build: drift_checker
working_dir: /usr/src
mem_limit: 128m
cpus: 0.2
And with the following code:
def handler(event, context):
return {
"statusCode": 200,
"headers": {
"Content-Type": "application/json"
},
"body": {}
}
The following error is returned:
src-apigw-1 | 2022-11-11T22:39:57.504677Z INFO aws_lambda_rie_gateway: Send upstream request: {"version":"2.0","routeKey":null,"rawPath":"/","rawQueryString":null,"cookies":null,"headers":{"host":"docker:8080","user-agent":"curl/7.82.0","accept":"*/*","content-length":"197","content-type":"application/x-www-form-urlencoded"},"queryStringParameters":{},"pathParameters":{},"requestContext":{"routeKey":"$default","accountId":"","stage":"$default","requestId":"","authorizer":null,"apiId":"","domainName":"","domainPrefix":"","time":"11/Nov/2022:22:39:57 +0000","timeEpoch":1668206397504,"http":{"method":"POST","path":"/","protocol":"HTTP/1.1","sourceIp":null,"userAgent":null},"authentication":null},"stageVariables":{},"body":"[REDACTED]","isBase64Encoded":true}
src-apigw-1 | 2022-11-11T22:40:03.685465Z ERROR aws_lambda_rie_gateway: error decoding response body: missing field `cookies` at line 1 column 3369
Of course, if I change the implementation to include a cookies
field in the response, it works flawlessly =D
Now, I don´t know if there is documentation describing how each response interface should be treated, but I would like to suggest making cookies
an optional attribute.
What do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.