scaffolding for new seasons
This commit is contained in:
@@ -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)
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user