Run Existing Web Apps on AWS Lambda With Almost No Refactoring

https://hackernoon.imgix.net/images/GKMDC80avThn4WCIH2KxmeCMx9o1-xc82c0j.png

If you have an async app, an internal tool, side project or PoC, there's no reason to pay for a machine that's awake all day for a job that takes so little time. That's where AWS Lambda comes in, charging you only when your function gets executed, with a generous free tier. So how do you take what you have, written with FastAPI, Express, Django, Fastify or whatever, and drop it into Lambda without a lot of refactoring?

AWS Lambda Web Adapter

AWS maintains an open source project called the Lambda Web Adapterwhich is a small proxy that sits in front of your app. Lambda invokes the adapter, the adapter translates the event into a plain HTTP request, forwards it to your app and translates the response back into whatever shape Lambda expects. Your app has no idea it's running inside Lambda. It just sees an HTTP request on...

Copyright of this story solely belongs to hackernoon.com. To see the full text click HERE

Read more