diff options
author | RandomChars <random@chars.jp> | 2021-09-24 20:23:29 +0900 |
---|---|---|
committer | RandomChars <random@chars.jp> | 2021-09-24 20:23:29 +0900 |
commit | deae86a0bfc5d27e8cd564a7127925f74284cc5f (patch) | |
tree | eb0ca1ffab3beb5956e43ba27a1cfaecd796dbbe | |
parent | 1b1147e422aaa83c33e542c58c7649ceef18b030 (diff) |
redirect when no routev1.2.6
-rw-r--r-- | web.go | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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") }) } |