v1.4.0: Add creator attribution middleware

This commit is contained in:
Sʜɪɴᴇɪ Nᴏᴜᴢᴇɴ
2026-06-25 00:54:18 +05:30
parent 3a28c4d182
commit 9ada6e1016
3 changed files with 81 additions and 0 deletions
+8
View File
@@ -21,6 +21,7 @@ const express = require("express");
const anilist = require("../helpers/anilist");
const pipe = require("../helpers/pipe");
const { getCached, setCache } = require("../helpers/cache");
const { addCreatorInfo } = require("../middleware/creatorInfo");
// ══════════════════════════════════════════════════════════════
// ROUTE REGISTRATION
@@ -39,6 +40,13 @@ const { getCached, setCache } = require("../helpers/cache");
const createApiRoutes = (jsonResponse, jsonError) => {
const router = express.Router();
// ══════════════════════════════════════════════════════════════
// CREATOR ATTRIBUTION (must be before all routes)
// ══════════════════════════════════════════════════════════════
// ---- FEATURE: Creator attribution middleware — injects author info into every response ----
router.use(addCreatorInfo);
// ══════════════════════════════════════════════════════════════
// REQUEST COUNTER (must be before all routes)
// ══════════════════════════════════════════════════════════════