This repository has been archived on 2019-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
scoreboard/features/api/server/handler.go

21 lines
434 B
Go
Raw Normal View History

2019-05-26 19:32:16 +00:00
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)
}))
})
}