refactor🎨:系统监控接口

This commit is contained in:
wenjianzhang
2021-06-16 18:33:14 +08:00
parent 5afe67bd1b
commit 869bea2163
+7 -9
View File
@@ -1,7 +1,6 @@
package router package router
import ( import (
"github.com/go-admin-team/go-admin-core/sdk/config"
"net/http" "net/http"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
@@ -15,11 +14,10 @@ func init() {
// 需认证的路由代码 // 需认证的路由代码
func registerMonitorRouter(v1 *gin.RouterGroup) { func registerMonitorRouter(v1 *gin.RouterGroup) {
if config.ApplicationConfig.Mode == "dev" { v1.GET("/metrics", transfer.Handler(promhttp.Handler()))
v1.GET("/metrics", transfer.Handler(promhttp.Handler())) //健康检查
//健康检查 v1.GET("/health", func(c *gin.Context) {
v1.GET("/health", func(c *gin.Context) { c.Status(http.StatusOK)
c.Status(http.StatusOK) })
})
} }
}