From 20041a898453b157f52ea67a4e8b6a38d6e3793d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=CA=9C=C9=AA=C9=B4=E1=B4=87=C9=AA=20N=E1=B4=8F=E1=B4=9C?= =?UTF-8?q?=E1=B4=A2=E1=B4=87=C9=B4?= <157171073+Shineii86@users.noreply.github.com> Date: Tue, 9 Jun 2026 15:04:26 +0530 Subject: [PATCH] v1.2.0: fix critical response format bug (18/18 endpoints passing) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Root cause: createApiRoutes() parameter shift - Function signature was (app, jsonResponse, jsonError) - Called from server.js as apiRoutes(jsonResponse, jsonError) - All params shifted: jsonResponse→jsonError, jsonError→undefined - Every success response returned {success: false, message: data} - Health worked because it used res.json() directly Fix: Removed unused 'app' parameter from createApiRoutes() All 18 endpoints now return {success: true, results: data} --- CHANGELOG.md | 7 +++++++ package.json | 2 +- src/routes/apiRoutes.js | 4 ++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0c885d..1144f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## v1.2.0 +- Fixed critical response format bug: all endpoints now return {success: true, results: data} +- Root cause: createApiRoutes() had (app, jsonResponse, jsonError) but was called with (jsonResponse, jsonError), shifting all params +- Every jsonResponse() call was actually calling jsonError(), returning {success: false, message: data} +- Health endpoint worked because it used res.json() directly, bypassing the wrapper +- All 18 endpoints verified working: health, stats, search, suggestions, filter, trending, popular, upcoming, recent, spotlight, schedule, info, characters, relations, recommendations, episodes, watch + ## v1.1.0 - Added Swagger UI interactive docs at /docs - Added OpenAPI 3.0 spec at /openapi.json diff --git a/package.json b/package.json index 2bb9544..a4773b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "miruro-api", - "version": "1.0.0", + "version": "1.2.0", "description": "RESTful API for miruro.com - Anime streaming data powered by AniList GraphQL and Miruro streaming providers", "main": "server.js", "scripts": { diff --git a/src/routes/apiRoutes.js b/src/routes/apiRoutes.js index eac101b..052151e 100644 --- a/src/routes/apiRoutes.js +++ b/src/routes/apiRoutes.js @@ -355,7 +355,7 @@ const createApiRoutes = (jsonResponse, jsonError) => { success: true, results: { status: "healthy", - version: "1.1.0", + version: "1.2.0", uptime: `${hours}h ${minutes}m ${seconds}s`, uptimeSeconds: uptime, timestamp: new Date().toISOString(), @@ -404,7 +404,7 @@ const createApiRoutes = (jsonResponse, jsonError) => { info: { title: "MiruroAPI", description: "Free REST API for anime streaming data — AniList GraphQL + Miruro streaming providers", - version: "1.1.0", + version: "1.2.0", contact: { name: "Shineii86", url: "https://github.com/Shineii86/MiruroAPI" }, }, servers: [