added server info for the / route
This commit is contained in:
parent
caea45741f
commit
c9ba660e7f
14
control.go
14
control.go
@ -126,3 +126,17 @@ func killServer(w http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
log.Fatal("shit got fucked up")
|
||||
}
|
||||
|
||||
func index(w http.ResponseWriter, req *http.Request) {
|
||||
log.Println("version requested")
|
||||
version := struct {
|
||||
Version string `json:"version"`
|
||||
Name string `json:"name"`
|
||||
}{
|
||||
Version: "0.1.2",
|
||||
Name: "Hackerbots",
|
||||
}
|
||||
if err := json.NewEncoder(w).Encode(version); err != nil {
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user