vivaplusdl/html_debug.go
Sebastiaan de Schaetzen 91be8274c4
All checks were successful
Build / build (push) Successful in 3m11s
UI is largely working
2025-03-16 18:11:34 +01:00

21 lines
412 B
Go

// / +build !release
package main
import (
"html/template"
"io"
"net/http"
)
func staticFileServer() http.Handler {
return http.FileServer(http.Dir("./static"))
}
func renderTemplate(wr io.Writer, templateName string, viewModel any) error {
templates, err := template.ParseGlob("web/*.go.html")
if err != nil {
return err
}
return templates.ExecuteTemplate(wr, templateName+".go.html", viewModel)
}