app.go (1182:325b315e48c4) app.go (1296:77f76e7b800f)
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
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
73 w.Write(data)
74}
75
76func main() {
77 http.HandleFunc("/", handler)
78 unit.ListenAndServe(":7080", nil)
79}
75 w.Write(data)
76}
77
78func main() {
79 http.HandleFunc("/", handler)
80 unit.ListenAndServe(":7080", nil)
81}