Menu

Turn WebSockets into Async/Await Requests (AWS WebSocket API Gateway + Lambda)
🖼️

Turn WebSockets into Async/Await Requests (AWS WebSocket API Gateway + Lambda)

DEV Community·Rishi·6 months ago
#14bdLu5X
Reading 0:00
15s threshold

Some time ago, I was building a chat application using AWS Websocket API gateway. Things were going smoothly. I created a WebSocket API Gateway, added $connect, $disconnect, and sendMessage/addGroup routes. From the frontend (React) side, everything was fire-and-forget. You send a message, and the onMessageHandler takes care of it 💪🏼

But then a new requirement of uploading files using S3 signed URLs came up. That's where I needed the Async/Await promise pattern. Now, one option was to create an HTTP API gateway and use it. But that meant a new connection, a new authorizer, and more setup.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.