diff options
Diffstat (limited to 'cmd/server/handlers.go')
| -rw-r--r-- | cmd/server/handlers.go | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/cmd/server/handlers.go b/cmd/server/handlers.go index 205d462..1711ae3 100644 --- a/cmd/server/handlers.go +++ b/cmd/server/handlers.go @@ -15,6 +15,13 @@ func (a *App) ServeHTTP(w http.ResponseWriter, r *http.Request) { rtr.HandleFunc(a.ReIndexPath, a.RebuildIndexHandler) rtr.PathPrefix("/static/").Handler(a.StaticHandler()) + rtr.HandleFunc("/login", a.LoginHandler) + rtr.Handle("/logout", a.RequiresLogin(http.HandlerFunc(a.LogoutHandler))) + rtr.PathPrefix("/edit/").Handler( + a.RequiresLogin(http.StripPrefix("/edit/", http.HandlerFunc(a.EditPage)))).Methods("GET") + rtr.PathPrefix("/edit/").Handler( + a.RequiresLogin(http.StripPrefix("/edit/", http.HandlerFunc(a.SaveEditPage)))).Methods("POST") + if a.redisPool != nil { rtr.PathPrefix(fmt.Sprintf("/%s/{tag}", a.FeedPrefix)).Handler( rediscache.HandleWithParams(a.redisPool, a.RedisKey, |
