Collections of tools to spinnup a Go server using exclusively the standard library.
Features
- Go template renderer
- Go template cache // Coming soon
- Logger middleware // Coming soon
tk := toolkit.Toolkit{
TmplsDir: "./ui/html/pages/", // Tmpl pages directory
BaseTmplDir: "./ui/html/partials/layout.tmpl", // Tmpl base layout directory
}
// Call inside a HTTP handler
tk.RenderTmpl(w, r, "home.tmpl", http.StatusOK, data)
Instalation
go get github.com/raiesbo/server-toolkit@latest