From eb50fd20bb1a1446b1a6338f13c1aae9599cea23 Mon Sep 17 00:00:00 2001 From: Jose Piedra Date: Tue, 3 Jan 2023 01:52:13 -0400 Subject: [PATCH] fix: episodes by key fix: redirect to docs feat: domains --- src/app.js | 2 +- src/config.js | 3 ++- src/controllers/episode.controller.js | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app.js b/src/app.js index 98ead32..73c542e 100644 --- a/src/app.js +++ b/src/app.js @@ -44,7 +44,7 @@ app.get('/api', (req, res) => { }); app.get('/docs', (req, res) => { - res.redirect('http://localhost:4200/home'); + res.redirect(config.docsUrl); }); //FUNCTIONAL ROUTES diff --git a/src/config.js b/src/config.js index 07fc5e4..3f785a5 100644 --- a/src/config.js +++ b/src/config.js @@ -4,7 +4,8 @@ config(); export default { - baseUrl: process.env.APIURL || 'http://localhost:3000', + baseUrl: process.env.API_URL || 'http://localhost:3000', + docsUrl: process.env.DOCS_URL, mongodbURL: process.env.MONGODB_URI || 'mongodb://Localhost/EDN', jwtKey: process.env.JWT_PASS, env: process.env.ENVIRONMENT, diff --git a/src/controllers/episode.controller.js b/src/controllers/episode.controller.js index 263d2d2..88deeb3 100644 --- a/src/controllers/episode.controller.js +++ b/src/controllers/episode.controller.js @@ -59,10 +59,11 @@ export const listEpByKey = async(req,res) => { res.status(200).json({ + episode, info: { - totalItems: episode.totalDocs, - totalPages: episode.totalPages, - currentPage: episode.page - 1 + totalItems: showEpisode.totalDocs, + totalPages: showEpisode.totalPages, + currentPage: showEpisode.page - 1 }, results: showEpisode.docs, });