
A Guide to Designing REST APIs Like a Pro Engineer
How Good Engineers Design REST APIs When engineers start building APIs for the first time, the endpoints often look like this: POST /createBlog GET /getBlogs POST /deleteBlog This works at the beginning. The API does what it needs to do, and the frontend can communicate with the backend. But as the system grows, this style quickly becomes messy. New endpoints appear for every action, naming becomes inconsistent, and the API slowly turns into a collection of unrelated routes. This happens because the API is designed around actions instead of resources . Good engineers approach API design differently. Instead of thinking about what action the client wants to perform , they think about what resource the system exposes . Think in Terms of Resources Every application revolves around a few core entities. If you are building a blog platform, those entities might be users, blogs, and comments. Instead of creating endpoints for every action, the API is designed around these resources. For examp
Continue reading on Dev.to Webdev
Opens in a new tab



