parent
02910b8b93
commit
859e3ad0e3
@ -1,10 +1,13 @@ |
|||||||
package admin |
package admin |
||||||
|
|
||||||
|
import ( |
||||||
|
"github.com/gofiber/fiber/v2" |
||||||
|
) |
||||||
|
|
||||||
func GetPageIndex(c *fiber.Ctx) error { |
func GetPageIndex(c *fiber.Ctx) error { |
||||||
c.Render("admin/index", fiber.Map{}) |
return c.Render("admin/index", fiber.Map{}) |
||||||
} |
} |
||||||
|
|
||||||
func Setup(app *fiber.App) { |
func Setup(app *fiber.App) { |
||||||
app.Get("/admin/", GetIndex); |
app.Get("/admin/", GetPageIndex); |
||||||
} |
} |
||||||
|
@ -0,0 +1,23 @@ |
|||||||
|
package tests |
||||||
|
|
||||||
|
import ( |
||||||
|
"testing" |
||||||
|
"fmt" |
||||||
|
"reflect" |
||||||
|
"zedshaw.games/webapp/data" |
||||||
|
// _ "github.com/mattn/go-sqlite3"
|
||||||
|
// "github.com/jmoiron/sqlx"
|
||||||
|
) |
||||||
|
|
||||||
|
func TestAdminIndexPage(t *testing.T) { |
||||||
|
models := data.Models() |
||||||
|
|
||||||
|
for table, model := range models { |
||||||
|
fmt.Printf("\n------\ntable=%s; model=%s\n", table, model.Name()) |
||||||
|
fields := reflect.VisibleFields(model) |
||||||
|
|
||||||
|
for _, field := range fields { |
||||||
|
fmt.Println("\t", field.Name, field.Type, field.Tag) |
||||||
|
} |
||||||
|
} |
||||||
|
} |
@ -0,0 +1 @@ |
|||||||
|
<h1>Admin!</h1> |
Loading…
Reference in new issue