We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f6a9951 commit f7b719bCopy full SHA for f7b719b
app.js
@@ -149,6 +149,17 @@ passport.deserializeUser(function (id, done) {
149
});
150
151
152
+// redirect url with trailing slashes
153
+app.use(function(req, res, next) {
154
+ if ("GET" == req.method && req.path.substr(-1) == '/' && req.path.length > 1) {
155
+ var query = req.url.slice(req.path.length);
156
+ console.log(config.serverurl + req.path.slice(0, -1) + query);
157
+ res.redirect(301, config.serverurl + req.path.slice(0, -1) + query);
158
+ } else {
159
+ next();
160
+ }
161
+});
162
+
163
// routes need sessions
164
//template files
165
app.set('views', __dirname + '/public');
0 commit comments