You've already forked coredns-powerdns-api-wrapper
30 lines
585 B
Go
30 lines
585 B
Go
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
// Copyright (C) 2026 Bryan Joshua Pedini
|
|
|
|
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,
|
|
})
|
|
}
|