refactored for maintainability
This commit is contained in:
@@ -3,6 +3,7 @@ package handlers
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"git.haelnorr.com/h/oslstats/internal/throw"
|
||||
"git.haelnorr.com/h/oslstats/internal/view/page"
|
||||
|
||||
"git.haelnorr.com/h/golib/hws"
|
||||
@@ -14,7 +15,7 @@ func Index(s *hws.Server) http.Handler {
|
||||
return http.HandlerFunc(
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path != "/" {
|
||||
throwNotFound(s, w, r, r.URL.Path)
|
||||
throw.NotFound(s, w, r, r.URL.Path)
|
||||
}
|
||||
renderSafely(page.Index(), s, r, w)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user