Made /api page

This commit is contained in:
2017-07-01 14:03:10 +02:00
parent 715686ddee
commit 6e41c08e60
5 changed files with 41 additions and 26 deletions

22
pages/apiview/api.go Normal file
View File

@ -0,0 +1,22 @@
package apiview
import (
"sort"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
// Get api page.
func Get(ctx *aero.Context) string {
types := []string{}
for typeName := range arn.DB.Types() {
types = append(types, typeName)
}
sort.Strings(types)
return ctx.HTML(components.API(types))
}