github.com/jxgolibs/go-oauth2-server@v1.0.1/health/routes.go (about)

     1  package health
     2  
     3  import (
     4  	"github.com/RichardKnop/go-oauth2-server/util/routes"
     5  	"github.com/gorilla/mux"
     6  )
     7  
     8  // RegisterRoutes registers route handlers for the health service
     9  func (s *Service) RegisterRoutes(router *mux.Router, prefix string) {
    10  	subRouter := router.PathPrefix(prefix).Subrouter()
    11  	routes.AddRoutes(s.GetRoutes(), subRouter)
    12  }
    13  
    14  // GetRoutes returns []routes.Route slice for the health service
    15  func (s *Service) GetRoutes() []routes.Route {
    16  	return []routes.Route{
    17  		{
    18  			Name:        "health_check",
    19  			Method:      "GET",
    20  			Pattern:     "/health",
    21  			HandlerFunc: s.healthcheck,
    22  		},
    23  	}
    24  }