move rendering funcs to handlers.go; use the render function on upload response

This commit is contained in:
2026-11-13 21:17:43 -05:00
parent 80e0efe3c4
commit 422a51d4d0
2 changed files with 15 additions and 18 deletions
-13
View File
@@ -12,19 +12,6 @@ import (
"strings"
)
func render(pages *template.Template, w http.ResponseWriter, name string, data any) {
w.Header().Set("Conten-Type", "text/html; charset=utf-8")
if err := pages.ExecuteTemplate(w, name, data); err != nil {
log.Printf("render %s: %v", name, err)
}
}
func staticPage(pages *template.Template, name string) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
render(pages, w, name, nil)
}
}
func main() {
config, err := loadConfig()
if err != nil {