We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9f8d162 commit cff745cCopy full SHA for cff745c
src/webserver.go
@@ -58,6 +58,11 @@ func runWebServer() {
58
// gin middleware to enable GZIP support
59
router.Use(gzip.Gzip(gzip.DefaultCompression))
60
61
+ // set 404 not found page
62
+ router.NoRoute(func(c *gin.Context) {
63
+ c.JSON(404, gin.H{"code": "PAGE_NOT_FOUND", "message": "Page not found"})
64
+ })
65
+
66
// disable proxy feature of gin
67
_ = router.SetTrustedProxies(nil)
68
0 commit comments