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.Info() if err != nil { return http.StatusNotFound, err } return response.New(s, r).Send(w, http.StatusOK) })) }) }