fix: Full diagnostic sweep — bugs, dead code, unused imports, docs accuracy

Code fixes:
- seasons/watchOrder: Remove dead ternary (both branches identical)
- mirror.helper: Remove redundant ternary (both branches identical)
- topAnimeRankings: Fix JSDoc (day/week/month, not top/newest)
- apiRoutes: Fix proxy domain validation (exact match, not includes)
- apiRoutes: Fix proxy .m3u8 check (pathname, not hostname)
- pagination: Fix totalItems calculation (was overestimating)
- server.js: Remove dead has404File variable
- server.js: Remove duplicate /api/cache/stats route
- server.js: Remove unused getCacheStats import

Unused imports removed:
- animeInfo: URLS from dataUrl.js
- episodeList: headers from header.config.js
- episodeListAjax: axios
- trending: URLS from dataUrl.js
- trendingSidebar: URLS from dataUrl.js
- upcomingAnime: parseListItems
- watchPage: URLS, BASE_URL from dataUrl.js

Docs fixes:
- README: 33->38 endpoints, 24->28 controllers, 26->28 extractors
- README: Cache TTL 5min->per-endpoint, Timeout 15s->30s
- docs/index.md: 33->38 endpoints
- architecture.md: LRU cache strategy, remove stale cookie-parser
- agents: compression version, extractor/controller counts
- agents: domain typo, stale CORS dep, version badge
This commit is contained in:
Shinei Nouzen
2026-07-30 00:50:18 +05:30
parent 715add099b
commit 996cead3b1
21 changed files with 24 additions and 40 deletions
+2 -3
View File
@@ -178,8 +178,8 @@ Client Response
## Caching Strategy
- **Type:** In-memory Map
- **TTL:** 5 minutes (300,000ms)
- **Type:** LRU Cache (Map-based with TTL expiration)
- **TTL:** Per-endpoint (3 min for search/stream, 5 min for home/trending, 10 min for info, 1 hour for schedule)
- **Key:** Full request URL
- **Behavior:** First request fetches from source, subsequent requests served from cache
- **Reset:** TTL resets on each access
@@ -252,6 +252,5 @@ Error responses:
| express | ^4.21.0 | Web framework |
| cheerio | ^1.0.0-rc.12 | HTML parsing |
| axios | ^1.8.0 | HTTP requests |
| cookie-parser | ^1.4.7 | Cookie parsing |
| dotenv | ^16.4.0 | Environment variables |
| compression | ^1.7.4 | Response compression |
+1 -1
View File
@@ -57,7 +57,7 @@ curl "https://anikototvapi.vercel.app/api/info?id=naruto-eybxz"
## Features
- **33 Endpoints** — Home, search, info, episodes, streaming, schedule, seasons, watch order, download, and more
- **38 Endpoints** — Home, search, info, episodes, streaming, schedule, seasons, watch order, download, and more
- **No API Key** — Just make requests, no registration needed
- **LRU Cache** — Configurable TTL per endpoint type (3min to 60min)
- **Multi-Mirror Fallback** — Automatic failover across 5 mirror domains