mirror of
https://github.com/Shineii86/MiruroAPI.git
synced 2026-10-22 10:15:10 +00:00
v1.4.0: Add creator attribution middleware
This commit is contained in:
@@ -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)
|
||||
// ══════════════════════════════════════════════════════════════
|
||||
|
||||
Reference in New Issue
Block a user