Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5e551b4eaf |
@@ -34,6 +34,7 @@ func getActiveIP() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func InfoHandler(w http.ResponseWriter, r *http.Request) {
|
func InfoHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
w.Header().Set("Content-Type", "application/json")
|
||||||
port := env.Port.GetValue()
|
port := env.Port.GetValue()
|
||||||
if port == "" {
|
if port == "" {
|
||||||
port = "8080"
|
port = "8080"
|
||||||
@@ -49,5 +50,9 @@ func InfoHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
"port": port,
|
"port": port,
|
||||||
"speed": GetInterval(),
|
"speed": GetInterval(),
|
||||||
}
|
}
|
||||||
json.NewEncoder(w).Encode(data)
|
err := json.NewEncoder(w).Encode(data)
|
||||||
|
if err != nil {
|
||||||
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user