Enha: index.html to template
This commit is contained in:
@ -18,6 +18,10 @@ func HandlePing(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
func HandleHome(w http.ResponseWriter, r *http.Request) {
|
||||
tmpl := template.Must(template.ParseFiles("components/index.html"))
|
||||
tmpl.Execute(w, roundWords)
|
||||
tmpl, err := template.ParseGlob("components/*.html")
|
||||
if err != nil {
|
||||
abortWithError(w, err.Error())
|
||||
return
|
||||
}
|
||||
tmpl.ExecuteTemplate(w, "main", roundWords)
|
||||
}
|
||||
|
Reference in New Issue
Block a user