From ee50a275e888c8230d2bf4af3d8a99844c7d669d Mon Sep 17 00:00:00 2001 From: Corey Peterson Date: Tue, 21 May 2024 10:25:12 -0400 Subject: [PATCH] Reorders routes in express to allow guide url resolution before catch-all old route handler --- express.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/express.js b/express.js index f413e95..408e381 100644 --- a/express.js +++ b/express.js @@ -557,12 +557,6 @@ app.get('/mwdk/widgets/1-mwdk/create', (req, res) => { res.render(res.locals.template, { layout: false}) }); -// old url -// redirect to home page since we can't set hash here -app.get('/mwdk/widgets/1-mwdk/:instance?', (req, res) => { - res.redirect('/') -}) - app.get('/mwdk/widgets/1-mwdk/creators-guide', (req, res) => { res.locals = Object.assign(res.locals, { template: 'guide_page', @@ -589,6 +583,12 @@ app.get('/mwdk/widgets/1-mwdk/players-guide', (req, res) => { res.render(res.locals.template, { layout: false}) }) +// old url +// redirect to home page since we can't set hash here +app.get('/mwdk/widgets/1-mwdk/:instance?', (req, res) => { + res.redirect('/') +}) + function generateInstanceID() { let str = "" for (let i = 0; i < 5; i++) {