diff --git a/configuration.html b/templates/configuration.tmpl similarity index 100% rename from configuration.html rename to templates/configuration.tmpl diff --git a/web.go b/web.go index 8be9dd2b2..3170f0d74 100644 --- a/web.go +++ b/web.go @@ -7,7 +7,6 @@ import ( "github.com/gorilla/handlers" "github.com/unrolled/render" "fmt" - "html/template" "io/ioutil" "encoding/json" "log" @@ -50,11 +49,5 @@ func GetConfigHandler(rw http.ResponseWriter, r *http.Request) { } func GetHtmlConfigHandler(response http.ResponseWriter, request *http.Request) { - templates := template.Must(template.ParseFiles("configuration.html")) - response.Header().Set("Content-type", "text/html") - err := request.ParseForm() - if err != nil { - http.Error(response, fmt.Sprintf("error parsing url %v", err), 500) - } - templates.ExecuteTemplate(response, "configuration.html", Page{Configuration:*currentConfiguration}) + renderer.HTML(response, http.StatusOK, "configuration", Page{Configuration:*currentConfiguration}) }