2022-12-07 21:24:11 -05:00
|
|
|
package web
|
|
|
|
|
|
|
|
import (
|
|
|
|
"net/http"
|
|
|
|
|
|
|
|
"github.com/flamego/flamego"
|
|
|
|
"github.com/flamego/template"
|
|
|
|
)
|
|
|
|
|
|
|
|
func RegisterRoutes(f *flamego.Flame) {
|
|
|
|
// index route - landing page for the user
|
|
|
|
f.Get("/", func(t template.Template, data template.Data) {
|
|
|
|
t.HTML(http.StatusOK, "index")
|
|
|
|
})
|
|
|
|
|
|
|
|
// item list route - lists all of the items in the database
|
2022-12-07 21:51:49 -05:00
|
|
|
f.Group("/item", func() {
|
|
|
|
f.Get("/list", func(t template.Template, data template.Data) {
|
|
|
|
t.HTML(http.StatusOK, "item/list")
|
|
|
|
})
|
|
|
|
|
|
|
|
f.Get("/create", func(t template.Template, data template.Data) {
|
|
|
|
t.HTML(http.StatusOK, "item/create")
|
|
|
|
})
|
|
|
|
})
|
2022-12-07 21:24:11 -05:00
|
|
|
}
|