Files
vctp2/server/handler/home.go
Nathan Coad 934c082ba1
Some checks are pending
CI / Lint (push) Waiting to run
CI / Test (push) Waiting to run
CI / End-to-End (push) Waiting to run
CI / Publish Docker (push) Blocked by required conditions
continuous-integration/drone/push Build is passing
change templ
2024-09-14 12:01:51 +10:00

31 lines
710 B
Go

package handler
import (
"net/http"
"vctp/components/views"
)
// Home handles the home page.
func (h *Handler) Home(w http.ResponseWriter, r *http.Request) {
//h.html(r.Context(), w, http.StatusOK, core.HTML("Example Site", home.Home()))
// Render the template
/*
err := home.Home(h.BuildTime, h.SHA1Ver, h.GoVersion).Render(r.Context(), w)
if err != nil {
http.Error(w, "Failed to render template", http.StatusInternalServerError)
}
*/
info := views.BuildInfo{
BuildTime: h.BuildTime,
SHA1Ver: h.SHA1Ver,
GoVersion: h.GoVersion,
}
err := views.Index(info).Render(r.Context(), w)
if err != nil {
http.Error(w, "Failed to render template", http.StatusInternalServerError)
}
}