1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
package backend import ( "html/template" "net/http" "github.com/go-chi/chi/v5" ) func HandleHome(r *chi.Mux) { r.Get("/", func(w http.ResponseWriter, r *http.Request) { t := template.Must(template.ParseFS(templates, "templates/home.html", "templates/base.html")) err := t.ExecuteTemplate(w, "base.html", &data{}) if err != nil { panic(err) } }) }