aboutsummaryrefslogtreecommitdiff
path: root/cmd/web/handlers/routes.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/web/handlers/routes.go')
-rw-r--r--cmd/web/handlers/routes.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/cmd/web/handlers/routes.go b/cmd/web/handlers/routes.go
index 5a57440..5c927c4 100644
--- a/cmd/web/handlers/routes.go
+++ b/cmd/web/handlers/routes.go
@@ -2,13 +2,17 @@ package handlers
import (
"github.com/gorilla/mux"
+ "paterissa.net/mblog/cmd/web/types"
)
-func RegisterEndpoints(webmaster string) *mux.Router {
- ctx := HandlerContext{webmaster}
+func RegisterEndpoints(app types.Application) *mux.Router {
+ ctx := blogContext{
+ err: app.Err,
+ Name: app.Env.Webmaster,
+ }
blogRouter := mux.NewRouter()
- blogRouter.HandleFunc("/", ctx.blogIndex)
+ blogRouter.HandleFunc("/", ctx.index)
return blogRouter
}