scaffolding for new seasons

This commit is contained in:
2026-02-02 19:12:14 +11:00
parent 9366481552
commit 9c70458b76
21 changed files with 520 additions and 41 deletions

View File

@@ -8,15 +8,15 @@ import (
"git.haelnorr.com/h/golib/hws"
)
// Handles responses to the / path. Also serves a 404 Page for paths that
// Index handles responses to the / path. Also serves a 404 Page for paths that
// don't have explicit handlers
func Index(server *hws.Server) http.Handler {
func Index(s *hws.Server) http.Handler {
return http.HandlerFunc(
func(w http.ResponseWriter, r *http.Request) {
if r.URL.Path != "/" {
throwNotFound(server, w, r, r.URL.Path)
throwNotFound(s, w, r, r.URL.Path)
}
page.Index().Render(r.Context(), w)
renderSafely(page.Index(), s, r, w)
},
)
}