Fixing an issue with redirect having the middleware applied before the redirection

This commit is contained in:
mike12345567 2021-09-06 15:48:46 +01:00
parent b3655bbee1
commit 033bd521cf
1 changed files with 2 additions and 3 deletions

View File

@ -53,6 +53,8 @@ router
})
.use("/health", ctx => (ctx.status = 200))
.use("/version", ctx => (ctx.body = pkg.version))
// re-direct before any middlewares occur
.redirect("/", "/builder")
.use(
buildAuthMiddleware(null, {
publicAllowed: true,
@ -93,7 +95,4 @@ for (let route of mainRoutes) {
router.use(staticRoutes.routes())
router.use(staticRoutes.allowedMethods())
// add a redirect for when hitting server directly
router.redirect("/", "/builder")
module.exports = router