// ListServicesHandler handles /services get request

ListServicesHandler handles /services get request
// ListServicesHandler handles / services get request
func ListServicesHandler(c *routing.Context) error {
	serviceDiscovery := ServiceDiscovery(c)
	searchQuery, page, err := parseListServicesHandlerParameters(c)
	if err != nil {
		return http.Error(c, err.Error(), 400, ServiceDiscoveryServiceName())
	}
	services := serviceDiscovery.ListServices(page, searchQuery)
	if len(services) == 0 {
		return http.Ok(c, `[]`, ServiceDiscoveryServiceName())
	}
	list, err := json.Marshal(services)
	if err != nil {
		return http.Error(c, `Error parsing body.`, 400, ServiceDiscoveryServiceName())
	}
	return http.Ok(c, string(list), ServiceDiscoveryServiceName())
}
func ListServicesHandler ( c * routing . Context ) error { serviceDiscovery := ServiceDiscovery ( c ) searchQuery , page , err := parseListServicesHandlerParameters ( c ) if err != nil { return http . Error ( c , err . Error ( ) , 400 , ServiceDiscoveryServiceName ( ) ) } services := serviceDiscovery . ListServices ( page , searchQuery ) if len ( services ) == 0 { return http . Ok ( c , `[]` , ServiceDiscoveryServiceName ( ) ) } list , err := json . Marshal ( services ) if err != nil { return http . Error ( c , `Error parsing body.` , 400 , ServiceDiscoveryServiceName ( ) ) } return http . Ok ( c , string ( list ) , ServiceDiscoveryServiceName ( ) ) }
ListServicesHandler handles /services get request
ListServicesHandler handles / services get request
// create service discovery object with authenticated user
 // Get page and search query parameters
