GET
/api/postsList posts
Returns a paginated list of posts. Supports selecting the page and items per page.
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
| page | query | number | No | 1 | Page number to fetch, starting at 1. |
| limit | query | number | No | 10 | Number of posts per page. Allowed range: 1 to 100. |
Example request
curl https://www.nguyenduongthevi.click/api/posts?page=1&limit=10Example response
{
"success": true,
"message": "Posts fetched",
"data": {
"items": [
{
"slug": "7-a3-injection-cross-site-scripting",
"title": "A3 — Injection: Cross-Site Scripting",
"date": "2024-05-12",
"description": "Tổng quan về tấn công XSS và cách phòng tránh...",
"tags": [
"security",
"owasp",
"xss"
],
"thumbnail": "/posts/xss.jpg",
"readTime": "6",
"author": "Nguyễn Dương Thế Vĩ"
}
],
"totalItems": 23,
"page": 1,
"perPage": 10,
"totalPages": 3
}
}Try it