Deleted Added
1package main
2
3import (
4 "encoding/json"
5 "fmt"
6 "net/http"
7 "nginx/unit"
8 "os"

--- 56 unchanged lines hidden (view full) ---

65 },
66 }
67 data, err := json.Marshal(out)
68 if err != nil {
69 w.WriteHeader(http.StatusInternalServerError)
70 return
71 }
72
73 w.Header().Add("Content-Type", "application/json")
74
75 w.Write(data)
76}
77
78func main() {
79 http.HandleFunc("/", handler)
80 unit.ListenAndServe(":7080", nil)
81}