Skip to content
Snippets Groups Projects
Commit deae86a0 authored by Ophestra's avatar Ophestra
Browse files

redirect when no route

parent 1b1147e4
Branches
Tags v1.2.6
No related merge requests found
......@@ -40,11 +40,9 @@ func webSetup() {
router.Use(gin.LoggerWithWriter(logger{}))
}
// Register error page
// Redirect on no route
router.NoRoute(func(context *gin.Context) {
context.JSON(http.StatusNotFound, gin.H{
"error": "no such file or directory",
})
context.Redirect(http.StatusTemporaryRedirect, "/web")
})
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment