Skip to content

Commit

Permalink
Reorders routes in express to allow guide url resolution before catch…
Browse files Browse the repository at this point in the history
…-all old route handler
  • Loading branch information
clpetersonucf committed May 21, 2024
1 parent 78ebe0f commit ee50a27
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions express.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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++) {
Expand Down

0 comments on commit ee50a27

Please sign in to comment.