by torginus · 1mo ago · 0 comments
https://github.com/CodeGenieApp/serverless-express
This wraps Lambda's 'handler' function and allows express to run on top of it, essentially you get a node web server with no persistence between requests which usually isn't a good thing to rely on, but you can also kinda have that with persistent tcp connections.
Of course since this is not real HTTP, things like WebSocket aren't available, but it's good enough to build a CRUD backend or two.
Similar libs exist for other runtimes as well.
But expensive. Stuff like Api Gateway is just absurd (but necessary since you don't want that stuff to reach your lambdas, which are dog slow to handle). Paying per request is like charging for every breath.
Another big advantage (and I guess the reason this exists), is for some reason, AWS lambda is a hostile environment for node, with its ephemeral VMs, performance is quite bad (much worse than expected)