fix(routes): prepend slash to wikipage that starts with "/"

- Closes #25
- Related #21
This commit is contained in:
Ming Di Leom
2021-12-08 11:04:06 +00:00
parent 37794684d5
commit 70145ff008
+5
View File
@@ -68,6 +68,11 @@ module.exports = (app, utils) => {
// This route handles wiki-pages starting with forward slash (issue #21))
app.get('/wiki//:page?/:sub_page?', (req, res, next) => {
const page = req.params.page
if(page) {
// issue #25
req.params.page = `/${req.params.page}`
}
return handleWikiPage(req, res, '/wiki/')
})