Trending images #77

Merged
bones7242 merged 9 commits from trending-images into master 2017-07-12 18:03:18 +02:00
2 changed files with 3 additions and 12 deletions
Showing only changes of commit 709db8e741 - Show all commits

View file

@ -1,19 +1,11 @@
const logger = require('winston');
const { postToStats, getTrendingClaims } = require('../controllers/statsController.js');
const errorHandlers = require('../helpers/libraries/errorHandlers.js');
const { postToStats } = require('../controllers/statsController.js');
module.exports = app => {
// route for the home page
app.get('/', ({ headers, ip, originalUrl }, res) => {
const startDate = new Date();
startDate.setDate(startDate.getDate() - 1);
getTrendingClaims(startDate)
.then(result => {
res.status(200).render('index', { trendingAssets: result });
})
.catch(error => {
errorHandlers.handleRequestError(error, res);
});
// send response
res.status(200).render('index');
});
// a catch-all route if someone visits a page that does not exist
app.use('*', ({ originalUrl, ip }, res) => {

View file

@ -3,7 +3,6 @@
<div class="full">
{{> publish}}
{{> learnMore}}
{{> trending}}
</div>
{{> footer}}
</div>