Skip to content

W0702: A hand-written folder-route option ​

web.PageRoute, web.LayoutOf, web.GuardOf, web.UseOf and web.Receiver are the options vuka writes in pages/route.go to register the folder routes. They are public so the generated file builds with go build, but they are not an API to write by hand: a page is a file under pages/, its layout a _layout.vuka.html, its guard and middleware a guard.go and a middleware.go in its folder. A handler — an API — is registered on the app, app.Get, or with web.Routes, what a route decorator on a function lowers to. Generated files and tests aren't reported.

Wrong ​

go
func init() {
	web.Routes.Get("/employers", employers.NewIndex, web.PageRoute(), web.LayoutOf[pages.Layout]())
}
text
pages/
  _layout.vuka.html        Layout
  employers/
    index.vuka.html        Index — /employers

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.