From 2266c8f0f84d8b38be080a8b8e19da14e76c48f9 Mon Sep 17 00:00:00 2001 From: json Date: Thu, 2 Sep 2021 21:00:26 +0100 Subject: [PATCH] separate gallery route --- routes/gallery.js | 7 +++++++ routes/index.js | 2 ++ 2 files changed, 9 insertions(+) create mode 100644 routes/gallery.js diff --git a/routes/gallery.js b/routes/gallery.js new file mode 100644 index 0000000..3590aca --- /dev/null +++ b/routes/gallery.js @@ -0,0 +1,7 @@ +const galleryRoute = require('express').Router(); + +galleryRoute.get('/gallery/:id', (req, res, next) => { + return res.redirect(`/comments/${req.params.id}`); +}); + +module.exports = galleryRoute; diff --git a/routes/index.js b/routes/index.js index 8763311..f5caf33 100644 --- a/routes/index.js +++ b/routes/index.js @@ -1,3 +1,4 @@ +const galleryRoute = require('./gallery'); const homeRoute = require('./home'); const overridingRoutes = require('./overides'); const preferenceRoutes = require('./preferences'); @@ -19,5 +20,6 @@ allRoutes.use(subscriptionRoutes); allRoutes.use(saveRoutes); allRoutes.use(searchRoute); allRoutes.use(homeRoute); +allRoutes.use(galleryRoute); module.exports = allRoutes;