require all route helper functions

This commit is contained in:
json 2021-09-02 21:23:28 +01:00
parent a441ecac33
commit 57c149d355
4 changed files with 36 additions and 3 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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')();

View File

@ -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 = '';