Skip to content

Commit

Permalink
Register custom package to Router and QueryRouter
Browse files Browse the repository at this point in the history
  • Loading branch information
orkunkl committed Aug 9, 2019
1 parent ccd74cb commit 665df47
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"github.com/iov-one/weave/x/sigs"
"github.com/iov-one/weave/x/utils"
"github.com/iov-one/weave/x/validators"
"github.com/iov-one/weave-starter-kit/x/custom"
)

// Authenticator returns authentication with multisigs
Expand Down Expand Up @@ -69,11 +70,12 @@ func Router(authFn x.Authenticator, issuer weave.Address) *app.Router {
currency.RegisterRoutes(r, authFn, issuer)
migration.RegisterRoutes(r, authFn)
validators.RegisterRoutes(r, authFn)
custom.RegisterRoutes(r, authFn)
return r
}

// QueryRouter returns a default query router,
// allowing access to "/auth", "/contracts", "/wallets", "/validators" and "/"
// allowing access to "/custom", "/auth", "/contracts", "/wallets", "/validators" and "/"
func QueryRouter() weave.QueryRouter {
r := weave.NewQueryRouter()
r.RegisterAll(
Expand All @@ -84,6 +86,7 @@ func QueryRouter() weave.QueryRouter {
migration.RegisterQuery,
orm.RegisterQuery,
validators.RegisterQuery,
custom.RegisterQuery,
)
return r
}
Expand Down

0 comments on commit 665df47

Please sign in to comment.