Skip to content
Snippets Groups Projects
Commit 4ad99b20 authored by Hans Kristian Hoel's avatar Hans Kristian Hoel
Browse files

have added status code for database in handlerstatus

parent 7fce9a74
No related branches found
No related tags found
No related merge requests found
......@@ -143,6 +143,14 @@ func HandlerStatus(w http.ResponseWriter, r *http.Request) {
S.Gitlab = resp.StatusCode
resp, err = http.Get("https://git.gvk.idi.ntnu.no") //må endre link
if err != nil {
http.Error(w, err.Error(), http.StatusBadRequest)
return
}
S.Database = resp.StatusCode
http.Header.Add(w.Header(), "Content-Type", "application/json") // makes the print look good
json.NewEncoder(w).Encode(S)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment