Skip to content

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()) }
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()) }

Released under the MIT License. Vuka builds on Go and its tools, which are made by the Go Authors. Vuka is not affiliated with Google or the Go project. Go is a trademark of Google LLC.