blt/web/routes.go

27 lines
561 B
Go
Raw Normal View History

package web
import (
2023-11-28 16:36:11 -05:00
"github.com/flamego/binding"
"github.com/flamego/flamego"
2023-11-28 16:36:11 -05:00
"git.metaunix.net/bitgoblin/blt/web/forms"
"git.metaunix.net/bitgoblin/blt/web/routes"
)
func RegisterRoutes(f *flamego.Flame) {
// index routes
f.Get("/", routes.GetDashboard)
2023-12-02 22:16:16 -05:00
// test routes
f.Group("/test", func() {
f.Get("", func(c flamego.Context) {
2023-12-02 22:16:16 -05:00
c.Redirect("/test/list")
})
2023-12-02 22:16:16 -05:00
f.Get("/list", routes.TestGetList)
2023-12-02 22:16:16 -05:00
f.Get("/create", routes.TestGetCreate)
f.Post("/create", binding.Form(forms.TestForm{}), routes.TestPostCreate)
})
}