21 lines
421 B
Go
Raw Normal View History

2017-06-20 20:54:45 +00:00
package popularanime
import (
2017-06-23 22:36:07 +00:00
"net/http"
2017-06-20 20:54:45 +00:00
"github.com/aerogo/aero"
2017-06-23 22:12:05 +00:00
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
2017-06-20 20:54:45 +00:00
)
// Get search page.
func Get(ctx *aero.Context) string {
2017-06-23 22:12:05 +00:00
animeList, err := arn.GetPopularAnimeCached()
if err != nil {
2017-06-23 22:36:07 +00:00
return ctx.Error(http.StatusInternalServerError, "Error fetching popular anime", err)
2017-06-23 22:12:05 +00:00
}
return ctx.HTML(components.AnimeGrid(animeList))
2017-06-20 20:54:45 +00:00
}