You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
332 B
17 lines
332 B
package handlers |
|
|
|
import ( |
|
"html/template" |
|
"net/http" |
|
) |
|
|
|
type Handler struct { |
|
Template template.Template |
|
} |
|
|
|
func (h *Handler) Home(w http.ResponseWriter, r *http.Request) { |
|
err := h.Template.ExecuteTemplate(w, "index.html", nil) |
|
if err != nil { |
|
http.Error(w, "Template rendering error", http.StatusInternalServerError) |
|
} |
|
}
|
|
|