Move html pages to a package

That way I can separate out HTML for the public-facing report system and
Nidus sync.
This commit is contained in:
Eli Ribble 2026-01-07 15:34:09 +00:00
parent 8c1026a653
commit 4c23eba5d7
51 changed files with 45 additions and 43 deletions

13
htmlpage/response.go Normal file
View file

@ -0,0 +1,13 @@
package htmlpage
import (
"net/http"
"github.com/rs/zerolog/log"
)
// Respond with an error that is visible to the user
func respondError(w http.ResponseWriter, m string, e error, s int) {
log.Warn().Int("status", s).Err(e).Str("user message", m).Msg("Responding with an error")
http.Error(w, m, s)
}