Structuring your REST APIs the correct way!
More than half of the industry is writing wrong REST APIs! Anyone is writing any kind of APIs and terms it REST!
The basics of REST API -
While there are multiple things to see in REST, the basics are that your endpoint is always resource oriented, and your request method is always action oriented.
For example
Endpoints should be based on resources / entities
Recommended by LinkedIn
Actions should be based on Request Method, not endpoint
Structuring your APIs
Another thing to keep in mind is the way you structure your resources using Inheritance.
Let's say you have multiple resources/entities in the system - Products, Users, Orders
These are few basics which should be very important in designing APIs as there are many people who want to understand how is the system built as well as maintained given multiple Entities and Actions.
If you like this post, do subscribe to my newsletter here, and give this article a ❤️.
JavaScript Developer | React.js | Next.js | Node.js | Express.js | TypeScript | AWS
1yBtw, how do you know approx 50% of engineers are wrong in writing APIs?