Files
hucan 8ae43bfba9
Some checks failed
Build / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
build / Build (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
Issue Close Require / issue-close-require (push) Has been cancelled
Issue Check Inactive / issue-check-inactive (push) Has been cancelled
1
2025-06-29 00:36:30 +08:00

23 lines
498 B
Go

package router
import (
"net/http"
"github.com/gin-gonic/gin"
"github.com/go-admin-team/go-admin-core/tools/transfer"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
func init() {
routerNoCheckRole = append(routerNoCheckRole, registerMonitorRouter)
}
// 需认证的路由代码
func registerMonitorRouter(v1 *gin.RouterGroup) {
v1.GET("/metrics", transfer.Handler(promhttp.Handler()))
//健康检查
v1.GET("/health", func(c *gin.Context) {
c.Status(http.StatusOK)
})
}