Support redd.it short url redirections

Close #273
This commit is contained in:
Austin Huang
2022-01-26 13:52:36 -05:00
parent 1efe34c0ad
commit 08437d8663

View File

@@ -32,6 +32,16 @@ homeRoute.get('/:sort?', async (req, res, next) => {
}
}
let is_comment =
sortby.length == 6 &&
sortby != "rising"
? true
: false;
if (is_comment) {
return res.redirect('/comments/' + sortby);
}
let d = `&after=${after}`;
if (before) {
d = `&before=${before}`;