Route

Route #

  • Functions handle incoming request and outcoming response
  • Route uses handler
func ExampleRoute(app hiro.Hiro) {
    app.Route(
        "/example",
        example_handler.Example(),
        Method(http.MethodGet, http.MethodPost),
        Name("example"),
    )
}

Config #

Method #

  • Route is created with all http methods by default
  • You can override defaults and define custom http methods
Method(http.MethodGet, http.MethodPost)

Name #

For routes matching and generating links

Name("example")

Layout #

  • Layouts are defined in app main.go file
  • Override main layout
Layout("custom_layout")