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))
|
||||
}
|
14
pages/apiview/api.pixy
Normal file
14
pages/apiview/api.pixy
Normal file
@ -0,0 +1,14 @@
|
||||
component API(types []string)
|
||||
h2.page-title API
|
||||
|
||||
h3 Types
|
||||
table
|
||||
//- thead
|
||||
//- tr
|
||||
//- th Table
|
||||
tbody
|
||||
each typeName in types
|
||||
tr
|
||||
td= typeName
|
||||
td
|
||||
a(href="/api/" + strings.ToLower(typeName) + "/")= "/api/" + strings.ToLower(typeName) + "/"
|
Reference in New Issue
Block a user