Skip to content

Commit

Permalink
rename hosts route
Browse files Browse the repository at this point in the history
  • Loading branch information
chris124567 committed Dec 18, 2024
1 parent c049a7e commit 72fdfd5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion api/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,6 @@ func (c *Client) Search(id types.Hash256) (resp explorer.SearchType, err error)

// HostsList searches the hosts by the given criteria.
func (c *Client) HostsList(params explorer.HostQuery, sortBy explorer.HostSortColumn, dir explorer.HostSortDir, offset, limit uint64) (resp []explorer.Host, err error) {
err = c.c.POST(fmt.Sprintf("/hosts/list?sort=%s&dir=%s&offset=%d&limit=%d", sortBy, dir, offset, limit), params, &resp)
err = c.c.POST(fmt.Sprintf("/hosts?sort=%s&dir=%s&offset=%d&limit=%d", sortBy, dir, offset, limit), params, &resp)
return
}
4 changes: 2 additions & 2 deletions api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ func (s *server) pubkeyHostHandler(jc jape.Context) {
jc.Encode(hosts[0])
}

func (s *server) hostsListHandler(jc jape.Context) {
func (s *server) hostsHandler(jc jape.Context) {
var params explorer.HostQuery
if jc.Decode(&params) != nil {
return
Expand Down Expand Up @@ -750,7 +750,7 @@ func NewServer(e Explorer, cm ChainManager, s Syncer) http.Handler {
"GET /metrics/block/:id": srv.blocksMetricsIDHandler,
"GET /metrics/host": srv.hostMetricsHandler,

"POST /hosts/list": srv.hostsListHandler,
"POST /hosts": srv.hostsHandler,

"GET /search/:id": srv.searchIDHandler,
})
Expand Down

0 comments on commit 72fdfd5

Please sign in to comment.