Posts
LIVEBlog-style mock posts with author userId, tags, and a published flag.
Endpoints
- GETPOSTList or create
- GETPATCHDELETERead, update, or delete one/api/posts/:id
- GETPublished only
- GETSearch title and body
Query params
| Param | Description | Example |
|---|---|---|
| page | Page number · default 1 | page=2 |
| limit | Page size · default 12 · max 50 | limit=12 |
| search | Title or body | search=api |
| userId | Filter by author UUID | userId=… |
| published | true · false | published=true |
| sort | createdAt · title | sort=title |
| order | asc · desc | order=asc |
| lang | Pass fa for Persian text · omit for English | lang=fa |
| delay | Artificial wait in ms · max 5000 | delay=800 |
| status | Force error HTTP status · 400–599 | status=500 |
Request
1import axios from 'axios';2 3const { data } = await axios.get('/api/posts', {4 params: { limit: 12 },5});6console.log(data.data, data.pagination);Response
1{2 "data": [3 {4 "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",5 "userId": "550e8400-e29b-41d4-a716-446655440000",6 "title": "Why fake APIs speed up frontend work",7 "body": "Mock endpoints let UI teams ship screens before the backend is ready.",8 "tags": ["dx", "frontend", "mock"],9 "published": true10 }11 ],12 "pagination": {13 "page": 1,14 "limit": 12,15 "total": 24,16 "totalPages": 217 }18}