diff --git a/internal/handlers.go b/internal/handlers.go index 312e179..c4b777e 100644 --- a/internal/handlers.go +++ b/internal/handlers.go @@ -107,11 +107,11 @@ func (s *Server) AddHandler() httprouter.Handle { } } -// CachedHandler ... -func (s *Server) CachedHandler() httprouter.Handle { +// CacheHandler ... +func (s *Server) CacheHandler() httprouter.Handle { return func(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { ctx := NewContext(s.config, s.db, r) - s.render("cached", w, ctx) + s.render("cache", w, ctx) } } diff --git a/internal/server.go b/internal/server.go index 254fa4b..ff20a8d 100644 --- a/internal/server.go +++ b/internal/server.go @@ -285,6 +285,9 @@ func (s *Server) initRoutes() { s.router.GET("/search", s.SearchHandler()) + s.router.GET("/cache/:hash", s.CacheHandler()) + s.router.HEAD("/cache/:hash", s.CacheHandler()) + s.router.GET("/login", s.am.HasAuth(s.LoginHandler())) s.router.POST("/login", s.LoginHandler()) diff --git a/spyda.db/000000002.data b/spyda.db/000000003.data similarity index 100% rename from spyda.db/000000002.data rename to spyda.db/000000003.data