Add /cache route

This commit is contained in:
James Mills
2021-01-30 15:58:18 +10:00
parent c4f53a0be9
commit a9be838b0b
3 changed files with 6 additions and 3 deletions

View File

@@ -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)
}
}