Simplify root API

This commit is contained in:
Adam Ierymenko 2019-09-26 13:35:56 -07:00
parent 7061f13b24
commit 3b3e6d2bfc
No known key found for this signature in database
GPG key ID: C8877CF2D7A5D7F3
8 changed files with 149 additions and 299 deletions

View file

@ -355,6 +355,7 @@ func createAPIServer(basePath string, node *Node) (*http.Server, error) {
if req.Method == http.MethodPost || req.Method == http.MethodPut {
if queriedID == 0 {
apiSendObj(out, req, http.StatusBadRequest, nil)
} else {
}
} else if req.Method == http.MethodGet || req.Method == http.MethodHead {
roots := node.Roots()