Skip to content
This repository was archived by the owner on May 13, 2022. It is now read-only.

Commit b27d0ff

Browse files
author
Silas Davis
authored
Merge pull request #1408 from hyperledger/return-status-from-health
Return status from health check
2 parents 709b875 + cd84812 commit b27d0ff

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

vent/service/server.go

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package service
22

33
import (
44
"context"
5+
"encoding/json"
56
"net/http"
67

78
"github.com/hyperledger/burrow/logging"
@@ -70,6 +71,11 @@ func healthHandler(consumer *Consumer) func(resp http.ResponseWriter, req *http.
7071
resp.WriteHeader(http.StatusServiceUnavailable)
7172
} else {
7273
resp.WriteHeader(http.StatusOK)
74+
bs, err := json.Marshal(consumer.statusMessage())
75+
if err == nil {
76+
resp.Header().Set("Content-Type", "application/json")
77+
resp.Write(bs)
78+
}
7379
}
7480
}
7581
}

0 commit comments

Comments
 (0)