From bfa623ec1741b327c2e8710bc518e5d58b92f285 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Wed, 31 Jan 2018 19:21:00 -0800 Subject: [PATCH] removed unnecessary handlebars page routes --- routes/home-routes.js | 2 +- routes/page-routes.js | 28 ++-------------------------- 2 files changed, 3 insertions(+), 27 deletions(-) diff --git a/routes/home-routes.js b/routes/home-routes.js index 0879194a..dc23346d 100644 --- a/routes/home-routes.js +++ b/routes/home-routes.js @@ -6,6 +6,6 @@ module.exports = app => { // a catch-all route if someone visits a page that does not exist app.use('*', ({ originalUrl, ip }, res) => { // send response - res.status(404).render('fourOhFour'); + res.status(404).render('index'); }); }; diff --git a/routes/page-routes.js b/routes/page-routes.js index 21226c2d..6d46bf6e 100644 --- a/routes/page-routes.js +++ b/routes/page-routes.js @@ -1,5 +1,3 @@ -const errorHandlers = require('../helpers/errorHandlers.js'); -const { getTrendingClaims, getRecentClaims } = require('../controllers/statsController.js'); const { site } = require('../config/speechConfig.js'); module.exports = (app) => { @@ -21,28 +19,11 @@ module.exports = (app) => { res.status(301).redirect('/popular'); }); app.get('/popular', ({ ip, originalUrl }, res) => { - const startDate = new Date(); - startDate.setDate(startDate.getDate() - 1); - const dateTime = startDate.toISOString().slice(0, 19).replace('T', ' '); - getTrendingClaims(dateTime) - .then(result => { - res.status(200).render('popular', { - trendingAssets: result, - }); - }) - .catch(error => { - errorHandlers.handleRequestError(originalUrl, ip, error, res); - }); + res.status(200).render('index'); }); // route to display a list of the trending images app.get('/new', ({ ip, originalUrl }, res) => { - getRecentClaims() - .then(result => { - res.status(200).render('new', { newClaims: result }); - }) - .catch(error => { - errorHandlers.handleRequestError(originalUrl, ip, error, res); - }); + res.status(200).render('index'); }); // route to send embedable video player (for twitter) app.get('/embed/:claimId/:name', ({ params }, res) => { @@ -52,9 +33,4 @@ module.exports = (app) => { // get and render the content res.status(200).render('embed', { layout: 'embed', host, claimId, name }); }); - // route to display all free public claims at a given name - app.get('/:name/all', (req, res) => { - // get and render the content - res.status(410).send('/:name/all is no longer supported'); - }); };