E0331: A page backed by a component isn't a GET
A type routed as a page serves its component on a GET; its component's sets and calls are posted to the same path by the framework. Another verb can't route the type. Reported at boot, and by vukavet.
Wrong
vuka
@web.Post("/orders")
@ui.Island
type Orders struct{ Rows []Order }go
type Orders struct{ Rows []Order }
func NewOrders() *Orders { return &Orders{} }
func init() { web.Routes.Post("/orders", NewOrders, ui.Island()) }Right
vuka
@web.Get("/orders")
@ui.Island
type Orders struct{ Rows []Order }go
type Orders struct{ Rows []Order }
func NewOrders() *Orders { return &Orders{} }
func init() { web.Routes.Get("/orders", NewOrders, ui.Island()) }