Skip to content

Commit 3b17424

Browse files
author
Qi Xiao
committed
Update observer api prefix
1 parent 9d3ba9b commit 3b17424

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

sqlchain/observer/api.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,8 @@ func startAPI(service *Service, listenAddr string, version string) (server *http
688688
api := &explorerAPI{
689689
service: service,
690690
}
691-
v1Router := router.PathPrefix(apiProxyPrefix + "/v1").Subrouter()
691+
apiRouter := router.PathPrefix(apiProxyPrefix).Subrouter()
692+
v1Router := apiRouter.PathPrefix("/v1").Subrouter()
692693
v1Router.HandleFunc("/ack/{db}/{hash}", api.GetAck).Methods("GET")
693694
v1Router.HandleFunc("/offset/{db}/{offset:[0-9]+}",
694695
func(writer http.ResponseWriter, request *http.Request) {
@@ -700,9 +701,9 @@ func startAPI(service *Service, listenAddr string, version string) (server *http
700701
v1Router.HandleFunc("/count/{db}/{count:[0-9]+}", api.GetBlockByCount).Methods("GET")
701702
v1Router.HandleFunc("/height/{db}/{height:[0-9]+}", api.GetBlockByHeight).Methods("GET")
702703
v1Router.HandleFunc("/head/{db}", api.GetHighestBlock).Methods("GET")
703-
v2Router := router.PathPrefix(apiProxyPrefix + "/v2").Subrouter()
704+
v2Router := apiRouter.PathPrefix("/v2").Subrouter()
704705
v2Router.HandleFunc("/head/{db}", api.GetHighestBlockV2).Methods("GET")
705-
v3Router := router.PathPrefix(apiProxyPrefix + "/v3").Subrouter()
706+
v3Router := apiRouter.PathPrefix("/v3").Subrouter()
706707
v3Router.HandleFunc("/response/{db}/{hash}", api.GetResponse).Methods("GET")
707708
v3Router.HandleFunc("/block/{db}/{hash}", api.GetBlockV3).Methods("GET")
708709
v3Router.HandleFunc("/count/{db}/{count:[0-9]+}", api.GetBlockByCountV3).Methods("GET")

0 commit comments

Comments
 (0)