mirror of
https://github.com/codex-team/codex.docs.git
synced 2025-07-24 07:39:42 +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
|
@ -4,6 +4,10 @@ const router = express.Router();
|
|||
|
||||
/* GET home page. */
|
||||
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 });
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue