Posts & Comments API
30 posts, each owned by a user (userId), with 90 comments in total spread across them. Comments reference their post via postId, independent of the Users resource (like real blog comments, not necessarily from a registered user).
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /mock-data/posts | List posts. Supports ?userId=, ?page=, ?limit= (max 50). |
GET | /mock-data/posts/:id | Fetch a single post. |
GET | /mock-data/posts/:id/comments | All comments on that post. |
POST | /mock-data/posts | Fake create. Not persisted. |
PUT / PATCH | /mock-data/posts/:id | Fake update. Not persisted. |
DELETE | /mock-data/posts/:id | Fake delete. Not persisted. |
GET | /mock-data/comments | List comments. Supports ?postId=, ?page=, ?limit=. |
GET | /mock-data/comments/:id | Fetch a single comment. |
POST / PUT / PATCH / DELETE | /mock-data/comments / /mock-data/comments/:id | Same fake-CRUD pattern as posts. |
Example
{
"id": 1,
"userId": 8,
"title": "A guide to caching strategies",
"body": "A simpler approach turned out to work just as well."
}