Files
vctp2/server/handler/home.go
Nathan Coad ea1eeb5c21
Some checks failed
continuous-integration/drone Build is passing
CI / Lint (push) Has been cancelled
CI / Test (push) Has been cancelled
CI / End-to-End (push) Has been cancelled
CI / Publish Docker (push) Has been cancelled
update to support postgresql and add godocs
2026-01-13 17:05:14 +11:00

38 lines
926 B
Go

package handler
import (
"net/http"
"vctp/components/views"
)
// Home renders the web UI home page.
// @Summary Home page
// @Description Renders the main UI page.
// @Tags ui
// @Produce text/html
// @Success 200 {string} string "HTML page"
// @Failure 500 {string} string "Render failed"
// @Router / [get]
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)
}
}