Use Express similar to Serverless Framework example

Just curious if there is an example or if it is possible to have something similar to this Serverless Framework setup where you can just plugin an Express api into a lambda? I think it would be a great example to let people easily port over express apps with only a few changes.

Updating to say I used serverless-http and express in the lambda by essentially copying the Serverless Framework handler code and it seems to be working fine. I used the $default route on the Api stack to forward to the main Lambda. If anyone has experience doing this already or just using one route for your whole API I would love to hear any troubles or tips.

I do seem to get a “Unexpected Top Level Error: Error: socket hang up” Error after a while of local development not sure if that is related though.

The WebSocket error isn’t related I think. Have you tried the most recent version of SST? I think that issue is being worked on.

Also, make sure to join us on Slack, you might find some folks that are using Express the way you are.

Thanks, I will check out the Slack channel!

I am on 0.53.0 and I did notice the socket hangup happening in another example project straight from the repo. I see 53.2 is out I will try that.