forked from Cliffbreak/tsviewer
20 lines
434 B
Go
20 lines
434 B
Go
package server
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"git.cliffbreak.de/Cliffbreak/tsviewer/response"
|
|
)
|
|
|
|
func InfoAPIHandler(s Service) http.HandlerFunc {
|
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
|
response.Handler(w, r, response.HandlerFunc(func() (int, error) {
|
|
s, err := s.ServerInfo()
|
|
if err != nil {
|
|
return http.StatusNotFound, err
|
|
}
|
|
|
|
return response.New(s, r).Send(w, http.StatusOK)
|
|
}))
|
|
})
|
|
}
|