1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-07 22:45:23 +02:00

Merge branch 'master' into reactions

This commit is contained in:
DorofeevMark 2019-04-17 19:50:16 +03:00 committed by GitHub
commit 90d11ad9ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,14 @@ const verifyToken = require('./middlewares/token');
*/
router.get('*', verifyToken, async (req, res) => {
try {
const alias = await Aliases.get(req.originalUrl.slice(1)); // Cuts first '/' character
let url = req.originalUrl.slice(1); // Cuts first '/' character
const queryParamsIndex = url.indexOf('?');
if (queryParamsIndex !== -1) {
url = url.slice(0, queryParamsIndex); // Cuts off query params
}
const alias = await Aliases.get(url);
switch (alias.type) {
case Alias.types.PAGE: {