go webserver template added
Some checks failed
Update Child Repos / update (push) Failing after 1m2s

This commit is contained in:
2025-12-17 10:49:43 +01:00
parent 9cbfd850bc
commit 8d1555249a
11 changed files with 319 additions and 0 deletions

26
version.go Normal file
View File

@@ -0,0 +1,26 @@
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: "YASKM",
Version: APP_VERSION,
})
}