Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
// Redirect any route ?thread=<id> or ?t=<id> to /thread/<id>
const threadParamRedirect = (req, res, next) => {
const threadId = req.query.thread || req.query.t;
if (threadId) {
if (req.query.m) {
res.redirect(`/thread/${threadId}?m=${req.query.m}`);
} else {
res.redirect(`/thread/${threadId}`);
}
} else {
next();
}
};
export default threadParamRedirect;