Daily Shaarli
October 8, 2022
- Use Nouns to represent resources / Not Verbs
- Use Pluralized Nouns for resources
- Use hyphens (-) to improve the readability of URIs
- Use forward slashes (/) for hierarchy but not trailing forward slash (/)
- Avoid using file extensions
- Version your APIs:
http://api.example.com/v1
- Use query component to filter URI collection:
http://api.example.com/v1/store/employees?department=IT®ion=USA
There is an alternative to the SPA model: a new model with HTML only. It uses modern DOM-swapping interactivity libraries like Hotwire, HTMX, and Unpoly and... something that returns HTML as backend :)
Since version 7.0 has Ruby on Rails Hotwire backed-in!