- All Courses
- API Design with Node.js
- HTTP and REST Foundations
- Designing resources and URLs
Lesson 1.2
Designing resources and URLs
A URL should name a thing.
12mBeginner20.3k students
Overview
Things, not procedures
A URL should name a thing. Verbs belong in the method, so listing, fetching, and deleting a user are one path with three methods rather than three paths.
Nest a path only when the child genuinely belongs to the parent and cannot be addressed without it. Deeply nested paths become unusable the moment a resource needs to be reached another way.
Consistency beats elegance. Plural nouns everywhere, one casing convention, one date format — an API that is predictable is one people can guess correctly.
In this lesson you will:
- Name resources as nouns, consistently
- Nest only where ownership is real
- Keep identifiers stable
Resources
Notes are not saved yet — they clear when you leave this page.
Previous Lesson
Methods, status codes, and headers
5m
Content negotiation and versioning
4m