hello-world.go 375 B

123456789101112131415161718
  1. package e00_basics
  2. // @snippet_begin(HelloWorldSample)
  3. import (
  4. "github.com/qor5/web"
  5. . "github.com/theplant/htmlgo"
  6. )
  7. func HelloWorld(ctx *web.EventContext) (pr web.PageResponse, err error) {
  8. pr.Body = H1("Hello World")
  9. return
  10. }
  11. var HelloWorldPB = web.Page(HelloWorld) // this is already a http.Handler
  12. const HelloWorldPath = "/samples/hello_world"
  13. // @snippet_end