Obtain status info in JSON format
This commit is contained in:
1 parent
6efa794ab4
commit
c7af02776f
2 files changed
+83
No files matched your search
@@ -145,6 +145,11 @@ func handleHttp(router *weave.Router) {
|
||||
io.WriteString(w, fmt.Sprintln("Encryption", encryption))
|
||||
io.WriteString(w, router.Status())
|
||||
})
|
||||
http.HandleFunc("/status-json", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Access-Control-Allow-Origin", "*")
|
||||
json, _ := router.MarshalJSON()
|
||||
w.Write(json)
|
||||
})
|
||||
http.HandleFunc("/connect", func(w http.ResponseWriter, r *http.Request) {
|
||||
peer := r.FormValue("peer")
|
||||
if addr, err := net.ResolveTCPAddr("tcp4", weave.NormalisePeerAddr(peer)); err == nil {
|
||||
|
||||
Reference in new issue
Block a user