1
0
mirror of https://github.com/containous/traefik.git synced 2024-12-22 13:34:03 +03:00

web provider renderer

This commit is contained in:
emile 2015-09-09 10:29:49 +02:00
parent f6d587b16a
commit d3071ca110
2 changed files with 1 additions and 8 deletions

9
web.go
View File

@ -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})
}