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