package http
import (
"fmt"
"net/http"
)
const index = `
Chronograf API
`
// Redoc servers the swagger JSON using the redoc package.
func Redoc(swagger string) http.HandlerFunc {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html; charset=utf-8")
w.WriteHeader(http.StatusOK)
_, _ = w.Write([]byte(fmt.Sprintf(index, swagger)))
})
}