Menu

1 / 2

From Chaos to REST: How I Evolved My First AWS Lambda API

DEV Community·FeliDrummond·7 months ago
#S2BqjdBf
#api#architecture#aws#serverless#mensagem
Reading 0:00
15s threshold

In my last post, I talked about how I started using AWS Lambda and Amazon API Gateway to build my first API Building My First AWS Lambda API . But to be honest, what I had in the beginning wasn’t exactly a well-structured API. It was functional, but far from ideal. In this post, I want to show the real evolution of my code, going through three stages: a “task executor” (RPC/tunneling style), an API with standardized responses and error handling, and finally a proper REST API.

At first, everything revolved around a single endpoint using the POST method. The logic depended on a field called "tarefa" (task) inside the request body. In other words, instead of using HTTP itself to express the intention of the operation, I created a kind of manual command system. Something like "tarefa": "delete_log" or "tarefa": "get_log". Although this works, this model follows a style closer to RPC (Remote Procedure Call), also known as tunneling.…

Continue reading — create a free account

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