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 62f0a57 commit 707d1afCopy full SHA for 707d1af
src/webserver.go
@@ -56,6 +56,11 @@ func runWebServer() {
56
// gin middleware to enable GZIP support
57
router.Use(gzip.Gzip(gzip.DefaultCompression))
58
59
+ // set 404 not found page
60
+ router.NoRoute(func(c *gin.Context) {
61
+ c.JSON(404, gin.H{"code": "PAGE_NOT_FOUND", "message": "Page not found"})
62
+ })
63
+
64
// disable proxy feature of gin
65
_ = router.SetTrustedProxies(nil)
66
0 commit comments