Files
go-template-container-webse…/version.go
Bryan Joshua Pedini 24e45d728d
All checks were successful
Update Child Repos / update (push) Successful in 7s
variabilized app name
2026-01-02 15:14:48 +01:00

27 lines
497 B
Go

package main
import (
_ "embed"
"html/template"
"net/http"
)
//go:embed templates/html/version.html
var versionTemplate string
func handleVersion(w http.ResponseWriter, r *http.Request) {
type SiteInfo struct {
CommitId string
Name string
Version string
}
tmpl, _ := template.New("version.html").Parse(versionTemplate)
// Return (write) the version to the response body
tmpl.Execute(w, SiteInfo{
CommitId: COMMIT_ID,
Name: ws.AppName,
Version: APP_VERSION,
})
}