mirror of
https://github.com/Shineii86/AniKotoAPI.git
synced 2026-10-22 02:45:10 +00:00
docs: update all documentation with pagination and fixes
- Update CHANGELOG.md with pagination metadata and bug fixes - Update README.md with pagination documentation and project structure - Update docs/endpoints.md with pagination section - Update docs/index.md with pagination feature - Update docs/architecture.md with pagination helper
This commit is contained in:
+5
-2
@@ -8,7 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
## [2.0.0] - 2026-07-04
|
## [2.0.0] - 2026-07-04
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
- **Creator Info Middleware**: Injects creator attribution (name, GitHub, Telegram, timestamp) into every JSON response
|
- **Pagination Metadata**: All list endpoints now include `pagination` object with `currentPage`, `totalPages`, `totalItems`, `itemsPerPage`, `hasNext`, `hasPrev`
|
||||||
|
- **Creator Info Middleware**: Injects creator attribution (name, GitHub, Telegram, message, timestamp) into every JSON response
|
||||||
- **Multi-Mirror Fallback System**: Automatic failover across 5 mirror domains (anikototv.to, anikoto.cz, anikoto.me, anikoto.net, anikototv.se)
|
- **Multi-Mirror Fallback System**: Automatic failover across 5 mirror domains (anikototv.to, anikoto.cz, anikoto.me, anikoto.net, anikototv.se)
|
||||||
- **LRU Cache with Configurable TTL**: Replaced basic Map cache with LRU cache supporting per-endpoint TTL (3min to 60min)
|
- **LRU Cache with Configurable TTL**: Replaced basic Map cache with LRU cache supporting per-endpoint TTL (3min to 60min)
|
||||||
- **Response Compression**: Added gzip compression middleware (level 6, 1024 byte threshold)
|
- **Response Compression**: Added gzip compression middleware (level 6, 1024 byte threshold)
|
||||||
@@ -39,7 +40,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Updated `test.js` with optional endpoint handling and performance metrics
|
- Updated `test.js` with optional endpoint handling and performance metrics
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- **CRITICAL**: Fixed header merging bug in mirror helper (custom headers were ignored)
|
- **CRITICAL**: Fixed `extractPages` URL handling bug causing doubled URLs in mirror fallback
|
||||||
|
- **CRITICAL**: Fixed `creatorInfo` middleware not including `message` field in responses
|
||||||
|
- Fixed header merging bug in mirror helper (custom headers were ignored)
|
||||||
- Fixed mirror URL construction (proper base URL handling)
|
- Fixed mirror URL construction (proper base URL handling)
|
||||||
- Fixed cache key sorting in filter controller
|
- Fixed cache key sorting in filter controller
|
||||||
- Fixed trailing slash inconsistency in console output
|
- Fixed trailing slash inconsistency in console output
|
||||||
|
|||||||
@@ -337,7 +337,8 @@ AniKotoAPI/
|
|||||||
│ │ ├── 📄 cache.helper.js # 💾 In-memory caching
|
│ │ ├── 📄 cache.helper.js # 💾 In-memory caching
|
||||||
│ │ ├── 📄 countPages.helper.js # 📄 Pagination counter
|
│ │ ├── 📄 countPages.helper.js # 📄 Pagination counter
|
||||||
│ │ ├── 📄 extractPages.helper.js # 📃 Page fetcher
|
│ │ ├── 📄 extractPages.helper.js # 📃 Page fetcher
|
||||||
│ │ └── 📄 formatTitle.helper.js # 🔤 Title formatter
|
│ │ ├── 📄 formatTitle.helper.js # 🔤 Title formatter
|
||||||
|
│ │ └── 📄 pagination.helper.js # 📊 Pagination metadata generator
|
||||||
│ │
|
│ │
|
||||||
│ ├── 📂 middleware/ # 🔧 Express middleware
|
│ ├── 📂 middleware/ # 🔧 Express middleware
|
||||||
│ │ └── 📄 creatorInfo.js # ✍️ Creator attribution injection
|
│ │ └── 📄 creatorInfo.js # ✍️ Creator attribution injection
|
||||||
@@ -1933,6 +1934,38 @@ console.log(resp.data);
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Pagination Metadata
|
||||||
|
|
||||||
|
All list endpoints include pagination metadata in the response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"results": {
|
||||||
|
"data": [...],
|
||||||
|
"pagination": {
|
||||||
|
"currentPage": 1,
|
||||||
|
"totalPages": 294,
|
||||||
|
"totalItems": 8820,
|
||||||
|
"itemsPerPage": 30,
|
||||||
|
"hasNext": true,
|
||||||
|
"hasPrev": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
|:---|:---|:---|
|
||||||
|
| `currentPage` | `number` | Current page number (1-indexed) |
|
||||||
|
| `totalPages` | `number` | Total number of pages available |
|
||||||
|
| `totalItems` | `number` | Estimated total items across all pages |
|
||||||
|
| `itemsPerPage` | `number` | Number of items per page (default: 30) |
|
||||||
|
| `hasNext` | `boolean` | Whether there is a next page |
|
||||||
|
| `hasPrev` | `boolean` | Whether there is a previous page |
|
||||||
|
|
||||||
|
**Endpoints with pagination:** `/api/search`, `/api/most-popular`, `/api/new-release`, `/api/newly-added`, `/api/latest-updated`, `/api/az-list/:letter`, `/api/filter`, `/api/genre/:name`, `/api/type/:name`, `/api/status/:name`
|
||||||
|
|
||||||
### Anime Item Object
|
### Anime Item Object
|
||||||
|
|
||||||
| Field | Type | Description | Example |
|
| Field | Type | Description | Example |
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ AniKotoAPI/
|
|||||||
│ └── helper/
|
│ └── helper/
|
||||||
│ ├── cache.helper.js # LRU cache with configurable TTL
|
│ ├── cache.helper.js # LRU cache with configurable TTL
|
||||||
│ ├── mirror.helper.js # Multi-mirror fallback (5 domains)
|
│ ├── mirror.helper.js # Multi-mirror fallback (5 domains)
|
||||||
│ └── extractPages.helper.js # Page fetching with mirror fallback
|
│ ├── extractPages.helper.js # Page fetching with mirror fallback
|
||||||
|
│ └── pagination.helper.js # Pagination metadata generator
|
||||||
│
|
│
|
||||||
│ └── middleware/
|
│ └── middleware/
|
||||||
│ └── creatorInfo.js # Creator attribution injection
|
│ └── creatorInfo.js # Creator attribution injection
|
||||||
|
|||||||
@@ -4,6 +4,40 @@ Base URL: `https://anikototvapi.vercel.app/api`
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Pagination
|
||||||
|
|
||||||
|
All list endpoints include pagination metadata in the response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"success": true,
|
||||||
|
"results": {
|
||||||
|
"data": [...],
|
||||||
|
"pagination": {
|
||||||
|
"currentPage": 1,
|
||||||
|
"totalPages": 294,
|
||||||
|
"totalItems": 8820,
|
||||||
|
"itemsPerPage": 30,
|
||||||
|
"hasNext": true,
|
||||||
|
"hasPrev": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Field | Type | Description |
|
||||||
|
|:---|:---|:---|
|
||||||
|
| `currentPage` | `number` | Current page number (1-indexed) |
|
||||||
|
| `totalPages` | `number` | Total number of pages available |
|
||||||
|
| `totalItems` | `number` | Estimated total items across all pages |
|
||||||
|
| `itemsPerPage` | `number` | Number of items per page (default: 30) |
|
||||||
|
| `hasNext` | `boolean` | Whether there is a next page |
|
||||||
|
| `hasPrev` | `boolean` | Whether there is a previous page |
|
||||||
|
|
||||||
|
**Endpoints with pagination:** `/api/search`, `/api/most-popular`, `/api/new-release`, `/api/newly-added`, `/api/latest-updated`, `/api/az-list/:letter`, `/api/filter`, `/api/genre/:name`, `/api/type/:name`, `/api/status/:name`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## GET /
|
## GET /
|
||||||
|
|
||||||
Returns homepage data: spotlight anime, trending, top-airing, and genres.
|
Returns homepage data: spotlight anime, trending, top-airing, and genres.
|
||||||
|
|||||||
@@ -62,6 +62,7 @@ curl "https://anikototvapi.vercel.app/api/info?id=road-of-naruto-ggjw8"
|
|||||||
- **LRU Cache** — Configurable TTL per endpoint type (3min to 60min)
|
- **LRU Cache** — Configurable TTL per endpoint type (3min to 60min)
|
||||||
- **Multi-Mirror Fallback** — Automatic failover across 5 mirror domains
|
- **Multi-Mirror Fallback** — Automatic failover across 5 mirror domains
|
||||||
- **Response Compression** — Gzip compression for faster responses
|
- **Response Compression** — Gzip compression for faster responses
|
||||||
|
- **Pagination Metadata** — All list endpoints include `pagination` object with `currentPage`, `totalPages`, `hasNext`, `hasPrev`
|
||||||
- **CORS Enabled** — Access from any domain
|
- **CORS Enabled** — Access from any domain
|
||||||
- **JSON Responses** — Standardized `{success, results}` format
|
- **JSON Responses** — Standardized `{success, results}` format
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user