Config is the handler the serves the current configuration state as pretty-formatted text.
(c *config.Config)
| 25 | |
| 26 | // Config is the handler the serves the current configuration state as pretty-formatted text. |
| 27 | func Config(c *config.Config) http.Handler { |
| 28 | return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { |
| 29 | if _, err := w.Write([]byte(c.Print())); err != nil { |
| 30 | http.Error(w, err.Error(), http.StatusInternalServerError) |
| 31 | } |
| 32 | }) |
| 33 | } |
no test coverage detected