mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-19 05:09:41 +02:00
Implement default redirect (#99)
* Implement default redirect * Move startPage configuration to env * Remove console.log Change development config back to master * remove global middleware
This commit is contained in:
parent
b744ed592a
commit
40d5285e5e
2 changed files with 5 additions and 0 deletions
|
@ -8,6 +8,7 @@
|
||||||
{"title": "Support Project", "uri": "/support"}
|
{"title": "Support Project", "uri": "/support"}
|
||||||
],
|
],
|
||||||
"landingFrameSrc": "https://codex.so/editor?frame=1",
|
"landingFrameSrc": "https://codex.so/editor?frame=1",
|
||||||
|
"startPage": "codex",
|
||||||
"misprintsChatId": "12344564",
|
"misprintsChatId": "12344564",
|
||||||
"yandexMetrikaId": ""
|
"yandexMetrikaId": ""
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,10 @@ const router = express.Router();
|
||||||
|
|
||||||
/* GET home page. */
|
/* GET home page. */
|
||||||
router.get('/', verifyToken, async (req, res) => {
|
router.get('/', verifyToken, async (req, res) => {
|
||||||
|
const config = req.app.locals.config;
|
||||||
|
if (config.startPage) {
|
||||||
|
return res.redirect(config.startPage);
|
||||||
|
}
|
||||||
res.render('pages/index', { isAuthorized: res.locals.isAuthorized });
|
res.render('pages/index', { isAuthorized: res.locals.isAuthorized });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue