Add debug routes for eventbus & corredor service

This commit is contained in:
Denis Arh
2020-03-26 19:07:13 +01:00
parent ce10e46e71
commit db789e10fd
4 changed files with 44 additions and 0 deletions
+15
View File
@@ -2,6 +2,9 @@ package api
import (
"fmt"
"github.com/cortezaproject/corteza-server/pkg/corredor"
"github.com/cortezaproject/corteza-server/pkg/eventbus"
"github.com/davecgh/go-spew/spew"
"net/http"
"reflect"
"runtime"
@@ -29,3 +32,15 @@ func debugRoutes(r chi.Routes) http.HandlerFunc {
printRoutes(r, "")
}
}
func debugEventbus() http.HandlerFunc {
return func(w http.ResponseWriter, req *http.Request) {
spew.Fdump(w, eventbus.Service().Debug())
}
}
func debugCorredor() http.HandlerFunc {
return func(w http.ResponseWriter, req *http.Request) {
spew.Fdump(w, corredor.Service().Debug())
}
}