mirror of
https://github.com/ianramzy/decentralized-video-chat.git
synced 2025-02-20 23:15:01 +08:00
remove trailing slashes
This commit is contained in:
parent
879835dc6c
commit
95461f14e9
@ -15,6 +15,15 @@ const url = require("url"); // built-in utility
|
||||
// enable ssl redirect
|
||||
app.use(sslRedirect());
|
||||
|
||||
app.use(function (req, res, next) {
|
||||
if (req.path.substr(-1) === "/" && req.path.length > 1) {
|
||||
let query = req.url.slice(req.path.length);
|
||||
res.redirect(301, req.path.slice(0, -1) + query);
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
});
|
||||
|
||||
app.get("/", function (req, res) {
|
||||
res.sendFile(path.join(public, "landing.html"));
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user