diff --git a/things/api/http/channels.go b/things/api/http/channels.go index a965d8343..0cad86004 100644 --- a/things/api/http/channels.go +++ b/things/api/http/channels.go @@ -21,7 +21,7 @@ import ( "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) -func groupsHandler(svc groups.Service, r *chi.Mux, logger logger.Logger) http.Handler { +func groupsHandler(svc groups.Service, r *chi.Mux, logger logger.Logger) *chi.Mux { opts := []kithttp.ServerOption{ kithttp.ServerErrorEncoder(apiutil.LoggingErrorEncoder(logger, api.EncodeError)), } diff --git a/things/api/http/clients.go b/things/api/http/clients.go index 8695a7569..546c3f0f1 100644 --- a/things/api/http/clients.go +++ b/things/api/http/clients.go @@ -20,7 +20,7 @@ import ( "go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" ) -func clientsHandler(svc things.Service, r *chi.Mux, logger mglog.Logger) http.Handler { +func clientsHandler(svc things.Service, r *chi.Mux, logger mglog.Logger) *chi.Mux { opts := []kithttp.ServerOption{ kithttp.ServerErrorEncoder(apiutil.LoggingErrorEncoder(logger, api.EncodeError)), } diff --git a/things/api/http/transport.go b/things/api/http/transport.go index 6c0fb4131..8f111a837 100644 --- a/things/api/http/transport.go +++ b/things/api/http/transport.go @@ -16,8 +16,8 @@ import ( // MakeHandler returns a HTTP handler for Things and Groups API endpoints. func MakeHandler(tsvc things.Service, grps groups.Service, mux *chi.Mux, logger mglog.Logger, instanceID string) http.Handler { - clientsHandler(tsvc, mux, logger) - groupsHandler(grps, mux, logger) + mux = clientsHandler(tsvc, mux, logger) + mux = groupsHandler(grps, mux, logger) mux.Get("/health", magistrala.Health("things", instanceID)) mux.Handle("/metrics", promhttp.Handler()) diff --git a/users/api/clients.go b/users/api/clients.go index 3948abdbc..a647b794a 100644 --- a/users/api/clients.go +++ b/users/api/clients.go @@ -22,7 +22,7 @@ import ( ) // MakeHandler returns a HTTP handler for API endpoints. -func clientsHandler(svc users.Service, r *chi.Mux, logger mglog.Logger) http.Handler { +func clientsHandler(svc users.Service, r *chi.Mux, logger mglog.Logger) *chi.Mux { opts := []kithttp.ServerOption{ kithttp.ServerErrorEncoder(apiutil.LoggingErrorEncoder(logger, api.EncodeError)), } diff --git a/users/api/groups.go b/users/api/groups.go index f7e3e0bf9..8dc337520 100644 --- a/users/api/groups.go +++ b/users/api/groups.go @@ -22,7 +22,7 @@ import ( ) // MakeHandler returns a HTTP handler for Groups API endpoints. -func groupsHandler(svc groups.Service, r *chi.Mux, logger logger.Logger) http.Handler { +func groupsHandler(svc groups.Service, r *chi.Mux, logger logger.Logger) *chi.Mux { opts := []kithttp.ServerOption{ kithttp.ServerErrorEncoder(apiutil.LoggingErrorEncoder(logger, api.EncodeError)), } diff --git a/users/api/transport.go b/users/api/transport.go index 2bb91595d..43fe55fdf 100644 --- a/users/api/transport.go +++ b/users/api/transport.go @@ -16,8 +16,8 @@ import ( // MakeHandler returns a HTTP handler for Users and Groups API endpoints. func MakeHandler(cls users.Service, grps groups.Service, mux *chi.Mux, logger mglog.Logger, instanceID string) http.Handler { - clientsHandler(cls, mux, logger) - groupsHandler(grps, mux, logger) + mux = clientsHandler(cls, mux, logger) + mux = groupsHandler(grps, mux, logger) mux.Get("/health", magistrala.Health("users", instanceID)) mux.Handle("/metrics", promhttp.Handler())