Most of the backend adverts we read asked for REST API experience. REST is a style for designing APIs around resources (the things your app deals with, like products, orders and payments) and standard HTTP methods. Following it means other developers can guess how your API works before reading a word of documentation.
Resources and routes
Name routes after things, using plural nouns, and let the HTTP method say what to do:
| Method | Route | Meaning | |--------|---------------|--------------------| | GET | /orders | list orders | | POST | /orders | create an order | | GET | /orders/42 | get order 42 | | PATCH | /orders/42 | change part of it | | DELETE | /orders/42 | remove it |
Avoid verbs in the URL such as /createOrder. The method already says "create".
Status codes that mean something
200 OKfor a successful read or update201 Createdafter a successfulPOST, ideally returning the new record