mirror of
https://github.com/kataras/iris.git
synced 2026-01-07 20:17:05 +00:00
Add example of the powerful 'templ' generated templates
This commit is contained in:
18
_examples/view/templ/main.go
Normal file
18
_examples/view/templ/main.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/kataras/iris/v12"
|
||||
)
|
||||
|
||||
// 1.
|
||||
// $ go install github.com/a-h/templ/cmd/templ@latest
|
||||
// $ templ generate
|
||||
// $ go run .
|
||||
func main() {
|
||||
component := hello("Makis")
|
||||
|
||||
app := iris.New()
|
||||
app.Get("/", iris.Component(component))
|
||||
|
||||
app.Listen(":8080")
|
||||
}
|
||||
Reference in New Issue
Block a user