All checks were successful
Build / build (push) Successful in 3m15s
21 lines
410 B
Go
21 lines
410 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/*.gohtml")
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return templates.ExecuteTemplate(wr, templateName+".gohtml", viewModel)
|
|
}
|