feat: display name in /api endpoint.

This commit is contained in:
Fernandez Ludovic
2020-06-20 19:55:29 +02:00
parent b112c2640e
commit 1ef68230de

2
app.go
View File

@ -191,6 +191,7 @@ func apiHandler(w http.ResponseWriter, req *http.Request) {
URL string `json:"url,omitempty"` URL string `json:"url,omitempty"`
Host string `json:"host,omitempty"` Host string `json:"host,omitempty"`
Method string `json:"method,omitempty"` Method string `json:"method,omitempty"`
Name string `json:"name,omitempty"`
}{ }{
Hostname: hostname, Hostname: hostname,
IP: []string{}, IP: []string{},
@ -198,6 +199,7 @@ func apiHandler(w http.ResponseWriter, req *http.Request) {
URL: req.URL.RequestURI(), URL: req.URL.RequestURI(),
Host: req.Host, Host: req.Host,
Method: req.Method, Method: req.Method,
Name: name,
} }
ifaces, _ := net.Interfaces() ifaces, _ := net.Interfaces()