Made /api page
This commit is contained in:
22
pages/apiview/api.go
Normal file
22
pages/apiview/api.go
Normal 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))
|
||||
}
|
Reference in New Issue
Block a user