From 57c149d3551635a9d0de8b604c368adfd04b2873 Mon Sep 17 00:00:00 2001 From: json Date: Thu, 2 Sep 2021 21:23:28 +0100 Subject: [PATCH] require all route helper functions --- routes/home.js | 11 +++++++++++ routes/save.js | 9 +++++++++ routes/subreddit.js | 10 +++++++--- routes/user.js | 9 +++++++++ 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/routes/home.js b/routes/home.js index 93b364a..ceb5800 100644 --- a/routes/home.js +++ b/routes/home.js @@ -2,6 +2,17 @@ const config = require('../config'); const { redis, fetch } = require('../app'); const homeRoute = require('express').Router(); +const processUser = require('../inc/processJsonUser.js')(); +const processPost = require('../inc/processJsonPost.js')(); +const processAbout = require('../inc/processSubredditAbout.js')(); +const tedditApiUser = require('../inc/teddit_api/handleUser.js')(); +const processSearches = require('../inc/processSearchResults.js')(); +const processSubreddit = require('../inc/processJsonSubreddit.js')(); +const tedditApiSubreddit = require('../inc/teddit_api/handleSubreddit.js')(); +const processMoreComments = require('../inc/processMoreComments.js')(); +const processSubredditsExplore = + require('../inc/processSubredditsExplore.js')(); + homeRoute.get('/:sort?', async (req, res, next) => { let past = req.query.t; let before = req.query.before; diff --git a/routes/save.js b/routes/save.js index 3e7cf58..6a8cdbf 100644 --- a/routes/save.js +++ b/routes/save.js @@ -2,7 +2,16 @@ const config = require('../config'); const { redis, fetch } = require('../app'); const saveRoutes = require('express').Router(); +const processUser = require('../inc/processJsonUser.js')(); +const processPost = require('../inc/processJsonPost.js')(); +const processAbout = require('../inc/processSubredditAbout.js')(); +const tedditApiUser = require('../inc/teddit_api/handleUser.js')(); +const processSearches = require('../inc/processSearchResults.js')(); const processSubreddit = require('../inc/processJsonSubreddit.js')(); +const tedditApiSubreddit = require('../inc/teddit_api/handleSubreddit.js')(); +const processMoreComments = require('../inc/processMoreComments.js')(); +const processSubredditsExplore = + require('../inc/processSubredditsExplore.js')(); saveRoutes.get('/saved', (req, res, next) => { let saved = req.cookies.saved; diff --git a/routes/subreddit.js b/routes/subreddit.js index 0a11373..a8830dc 100644 --- a/routes/subreddit.js +++ b/routes/subreddit.js @@ -2,10 +2,14 @@ const config = require('../config'); const { redis, fetch, RedditAPI } = require('../app'); const subredditRoutes = require('express').Router(); -const processSubreddit = require('../inc/processJsonSubreddit.js')(); -const processAbout = require('../inc/processSubredditAbout.js')(); -const processSearches = require('../inc/processSearchResults.js')(); +const processUser = require('../inc/processJsonUser.js')(); const processPost = require('../inc/processJsonPost.js')(); +const processAbout = require('../inc/processSubredditAbout.js')(); +const tedditApiUser = require('../inc/teddit_api/handleUser.js')(); +const processSearches = require('../inc/processSearchResults.js')(); +const processSubreddit = require('../inc/processJsonSubreddit.js')(); +const tedditApiSubreddit = require('../inc/teddit_api/handleSubreddit.js')(); +const processMoreComments = require('../inc/processMoreComments.js')(); const processSubredditsExplore = require('../inc/processSubredditsExplore.js')(); diff --git a/routes/user.js b/routes/user.js index 26d83f7..4abd6cf 100644 --- a/routes/user.js +++ b/routes/user.js @@ -3,6 +3,15 @@ const { redis, fetch } = require('../app'); const userRoutes = require('express').Router(); const processUser = require('../inc/processJsonUser.js')(); +const processPost = require('../inc/processJsonPost.js')(); +const processAbout = require('../inc/processSubredditAbout.js')(); +const tedditApiUser = require('../inc/teddit_api/handleUser.js')(); +const processSearches = require('../inc/processSearchResults.js')(); +const processSubreddit = require('../inc/processJsonSubreddit.js')(); +const tedditApiSubreddit = require('../inc/teddit_api/handleSubreddit.js')(); +const processMoreComments = require('../inc/processMoreComments.js')(); +const processSubredditsExplore = + require('../inc/processSubredditsExplore.js')(); userRoutes.get('/user/:user/:kind?', (req, res, next) => { let kind = '';