package dashboard import ( "embed" "github.com/go-chi/chi/v5" "github.com/unrolled/render" "net/http" ) // content holds our static web server content. //go:embed templates/* var webserver embed.FS var ren *render.Render func Register(router chi.Router, template func(http.Handler) http.Handler) { ren = render.New(render.Options{ //Layout: "layout", FileSystem: &render.EmbedFileSystem{ FS: webserver, }, }) router.Group(func(r chi.Router) { r.Use(template) r.Get("/dashboard", sampleCall) }) } func sampleCall(w http.ResponseWriter, r *http.Request) { ren.HTML(w, http.StatusOK, "dashboard", map[string]string {"title": "World"}) }