All checks were successful
Build / build (push) Successful in 3m11s
21 lines
412 B
Go
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)
|
|
}
|