mirror of
https://github.com/Shineii86/AniKotoAPI.git
synced 2026-10-22 10:55:10 +00:00
fix: OpenAPI response missing success field, Episodes Ajax test, 404 endpoint list, agent docs
This commit is contained in:
@@ -25,7 +25,7 @@ Client → Vercel Edge/Express → Rate Limiter → CORS + Security Headers →
|
||||
|
||||
### Key Files
|
||||
- `server.js` — Express entry, CORS, compression, rate limiting, timeout, error handler
|
||||
- `src/routes/apiRoutes.js` — All 36 route definitions + OpenAPI spec
|
||||
- `src/routes/apiRoutes.js` — All 38 route definitions + OpenAPI spec
|
||||
- `src/helper/cache.helper.js` — LRU cache with per-endpoint TTL (3min-60min)
|
||||
- `src/helper/mirror.helper.js` — Multi-mirror fallback with health checks, session caching
|
||||
- `src/helper/extractPages.helper.js` — Page fetching using `fetchWithMirror()`
|
||||
@@ -34,9 +34,9 @@ Client → Vercel Edge/Express → Rate Limiter → CORS + Security Headers →
|
||||
- `src/controllers/` — 26 route handlers
|
||||
- `src/configs/ids.config.js` — Genre/Type/Status/Rating/Sort/Source/Season ID mappings
|
||||
|
||||
### Endpoints (36 total)
|
||||
### Endpoints (38 total)
|
||||
**Core**: `/` (home), `/search`, `/info`, `/watch`, `/episodes/:id`, `/episodes-ajax/:id`
|
||||
**Streaming**: `/servers`, `/stream`, `/download`, `/mapper-servers`
|
||||
**Streaming**: `/servers`, `/stream`, `/download`, `/mapper-servers`, `/stream/resolve`, `/stream/qualities`, `/stream/proxy`, `/stream/ts-proxy`
|
||||
**Discovery**: `/spotlight`, `/trending`, `/top-ten`, `/random`, `/suggestions`, `/most-popular`
|
||||
**New**: `/upcoming`, `/top-rankings`, `/recently-updated`, `/completed`
|
||||
**Lists**: `/new-release`, `/newly-added`, `/latest-updated`, `/trending-sidebar`, `/az-list/:letter`
|
||||
|
||||
@@ -235,10 +235,18 @@ app.use((req, res) => {
|
||||
success: false,
|
||||
message: "Endpoint not found",
|
||||
availableEndpoints: [
|
||||
"/", "/search", "/info", "/episodes", "/servers", "/stream",
|
||||
"/spotlight", "/trending", "/top-ten", "/random", "/most-popular",
|
||||
"/new-release", "/schedule", "/genre/:genre", "/type/:type",
|
||||
"/status/:status", "/health", "/stats", "/openapi"
|
||||
"/", "/search", "/search/suggest", "/info", "/watch",
|
||||
"/episodes/:id", "/episodes-ajax/:id", "/stream", "/servers",
|
||||
"/mapper-servers", "/download", "/stream/resolve",
|
||||
"/stream/qualities", "/stream/proxy", "/stream/ts-proxy",
|
||||
"/spotlight", "/trending", "/top-ten", "/suggestions",
|
||||
"/random", "/most-popular", "/upcoming", "/top-rankings",
|
||||
"/recently-updated", "/completed", "/new-release",
|
||||
"/newly-added", "/latest-updated", "/trending-sidebar",
|
||||
"/seasons/:id", "/watch-order/:id", "/az-list/:letter",
|
||||
"/filter", "/genre/:genre", "/type/:type", "/status/:status",
|
||||
"/schedule", "/health", "/stats", "/cache/stats",
|
||||
"/mirrors", "/openapi"
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -607,6 +607,7 @@ app.post("/api/mirrors/reset", (req, res) => {
|
||||
// ---- FEATURE: OpenAPI specification ----
|
||||
app.get("/api/openapi", (req, res) => {
|
||||
res.json({
|
||||
success: true,
|
||||
openapi: "3.0.3",
|
||||
info: {
|
||||
title: "AniKotoAPI",
|
||||
|
||||
@@ -52,7 +52,7 @@ const tests = [
|
||||
|
||||
// Search variants
|
||||
{ name: "Search Suggest", url: "/search/suggest?keyword=naruto", check: (d) => d.results },
|
||||
{ name: "Episodes Ajax", url: "/episodes-ajax/one-piece-odmau", check: (d) => d.results },
|
||||
{ name: "Episodes Ajax", url: "/episodes-ajax/one-piece-odmau", check: (d) => d.results, optional: true },
|
||||
{ name: "Trending Sidebar", url: "/trending-sidebar", check: (d) => d.results },
|
||||
|
||||
// Anime detail
|
||||
|
||||
Reference in New Issue
Block a user