summaryrefslogtreecommitdiff
path: root/views.go
diff options
context:
space:
mode:
Diffstat (limited to 'views.go')
-rw-r--r--views.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/views.go b/views.go
index 6bc915f..a78f8c8 100644
--- a/views.go
+++ b/views.go
@@ -25,6 +25,10 @@ func Views() *views {
func (v *views) Index() http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
+ if req.URL.Path != "/" {
+ http.NotFound(w, req)
+ return
+ }
if _, ok := req.Context().Value("user").(*User); ok {
err := v.templates["index"].ExecuteTemplate(w, "base", NewPageCtx(req))
if err != nil {
@@ -102,6 +106,7 @@ func NewPageCtx(req *http.Request) PageCtx {
"FlashClass": flash_class,
"User": user,
"CsrfField": csrf.TemplateField(req),
+ "BasePath": pwman.BasePath,
}
}