3 different concepts here:
- Resource:
{id: 42, type: employee, company: 5}
- Route:
localhost:8080/employees/42
- Endpoint:
GET localhost:8080/employees/42
You can have different endpoints for the same route, such as DELETE localhost:8080/employees/42
. So endpoints are basically actions.
Also you can access the same resource by different routes such as localhost:8080/companies/5/employees/42
. So a route is a way to locate a resource.
-
Read more: Endpoint vs. route
-
Read more: Endpoint vs. resource