Skip to content

Commit

Permalink
fix: episodes by key
Browse files Browse the repository at this point in the history
fix: redirect to docs

feat: domains
  • Loading branch information
piedraprog committed Jan 3, 2023
1 parent 07296cb commit eb50fd2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion src/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions src/controllers/episode.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down

0 comments on commit eb50fd2

Please sign in to comment.