asottile-archive / api-gateway-v2-to-wsgi Goto Github PK
View Code? Open in Web Editor NEWtranslation from the aws api gateway v2.0 lambda event to wsgi
License: MIT License
translation from the aws api gateway v2.0 lambda event to wsgi
License: MIT License
Just found this in my newsfeed. Is there a reason I would use this over e.g. https://github.com/Miserlou/Zappa (or at least over the parts of Zappa that deal with translation to WSGI)?
I just finished upgrading my similar package apig-wsgi to support v2. I used this library as reference. On the way I spotted a bug - the set-cookie
header in responses does work, but if a response sets more than one cookie, you can only have one header, so the other cookies will get dropped. You need to pull the cookie headers out into the cookies
return array.
Additionally ths library isn't returning the full response object (doc'd at bottom of this page), I'm not sure if there are potential issues there e.g. api gateway may try and infer if response content is base64 encoded (not documented ofc).
Hi -- I attempted to use this library yesterday and wanted to point out some issues that I encountered. These were both easy fixes and I like the lightweight nature of this library. I hesitated to open a PR or fork because I saw this was updated as recently as yesterday so figured it must be working for somebody.
body_b = body.encode() if body else b'' # will do the trick on 69
If others are running into the same issue I'll open a PR with the changes; if some are still using this successfully (perhaps for older versions of API v2?) I can open a PR that supports looking for keys in both formats.
presumably this is easy to implement I just didn't do it
my guess is that you'd put some code here and encode the response and set isBase64Encoded
in the response
I didn't need this for my use case so I didn't implement it
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.