Return info about blockbook as default response
This commit is contained in:
parent
8535786ce3
commit
66bf41720b
@ -85,7 +85,9 @@ func NewSocketIoServer(binding string, certFiles string, db *db.RocksDB, chain b
|
|||||||
// API call used to detect state of Blockbook
|
// API call used to detect state of Blockbook
|
||||||
serveMux.HandleFunc(path+"api/block-index/", s.apiBlockIndex)
|
serveMux.HandleFunc(path+"api/block-index/", s.apiBlockIndex)
|
||||||
// handle socket.io
|
// handle socket.io
|
||||||
serveMux.Handle(path, server)
|
serveMux.Handle(path+"socket.io/", server)
|
||||||
|
// default handler
|
||||||
|
serveMux.HandleFunc(path, s.index)
|
||||||
|
|
||||||
server.On("message", s.onMessage)
|
server.On("message", s.onMessage)
|
||||||
server.On("subscribe", s.onSubscribe)
|
server.On("subscribe", s.onSubscribe)
|
||||||
@ -129,6 +131,10 @@ func (s *SocketIoServer) txRedirect(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *SocketIoServer) index(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Write([]byte(blockbookAbout))
|
||||||
|
}
|
||||||
|
|
||||||
func (s *SocketIoServer) apiBlockIndex(w http.ResponseWriter, r *http.Request) {
|
func (s *SocketIoServer) apiBlockIndex(w http.ResponseWriter, r *http.Request) {
|
||||||
type resBlockIndex struct {
|
type resBlockIndex struct {
|
||||||
BlockHash string `json:"blockHash"`
|
BlockHash string `json:"blockHash"`
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user