mirror of
https://tangled.org/evan.jarrett.net/at-container-registry
synced 2026-08-29 20:27:16 +00:00
26 lines
492 B
Go
26 lines
492 B
Go
package handlers
|
|
|
|
import (
|
|
"html/template"
|
|
"net/http"
|
|
)
|
|
|
|
// InstallHandler handles the /install page
|
|
type InstallHandler struct {
|
|
Templates *template.Template
|
|
RegistryURL string
|
|
}
|
|
|
|
func (h *InstallHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|
data := struct {
|
|
PageData
|
|
}{
|
|
PageData: NewPageData(r, h.RegistryURL),
|
|
}
|
|
|
|
if err := h.Templates.ExecuteTemplate(w, "install", data); err != nil {
|
|
http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
return
|
|
}
|
|
}
|