feat: add complete API endpoints for full website

- Add /api/watch endpoint for watch page data
- Add /api/az-list for alphabetical browsing
- Add /api/new-release and /api/newly-added
- Add /api/status for ongoing/completed lists
- Add /api/trending-sidebar for sidebar data
- Update README with all new endpoints
- Update CHANGELOG
This commit is contained in:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-08 15:34:37 +05:30
parent cff5b394b3
commit 47789b2444
13 changed files with 632 additions and 1 deletions
+26
View File
@@ -0,0 +1,26 @@
import { extractWatchPage } from "../extractors/watchPage.extractor.js";
import { getCache, setCache } from "../helper/cache.helper.js";
const getWatchPage = async (req, res, next) => {
try {
const { slug, ep } = req.query;
if (!slug || !ep) {
return res.status(400).json({ success: false, message: "Slug and episode number are required" });
}
const cacheKey = `watch_${slug}_${ep}`;
const cached = getCache(cacheKey);
if (cached) {
return res.json({ success: true, results: cached });
}
const data = await extractWatchPage(slug, ep);
setCache(cacheKey, data);
res.json({ success: true, results: data });
} catch (error) {
next(error);
}
};
export { getWatchPage };