1
0
Fork 0
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:
Alexander Menshikov 2020-05-09 14:17:29 +03:00 committed by GitHub
parent b744ed592a
commit 40d5285e5e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View file

@ -8,6 +8,7 @@
{"title": "Support Project", "uri": "/support"}
],
"landingFrameSrc": "https://codex.so/editor?frame=1",
"startPage": "codex",
"misprintsChatId": "12344564",
"yandexMetrikaId": ""
}

View file

@ -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 });
});