I am using Node.js and Express and I have the following routing :
app.get(\'/\', function(req,res){ locals.date = new Date().toLocaleDateString(); r
Try adding a middleware for that;
app.use((req, res, next) => { const test = /\?[^]*\//.test(req.url); if (req.url.substr(-1) === '/' && req.url.length > 1 && !test) res.redirect(301, req.url.slice(0, -1)); else next(); });