iris/_examples/view/template_pug_3/main.go
Gerasimos (Makis) Maropoulos c13fd84354 fix https://github.com/kataras/iris/issues/1450 and continue on implementing 1449
Former-commit-id: 617f64d061e88f050a443ea1751fa244164656c5
2020-02-14 23:34:56 +02:00

24 lines
413 B
Go

package main
import "github.com/kataras/iris/v12"
// $ go get -u github.com/go-bindata/go-bindata/...
// $ go-bindata ./templates/...
// $ go build
func main() {
app := iris.New()
tmpl := iris.Pug("./templates", ".pug").Binary(Asset, AssetNames)
app.RegisterView(tmpl)
app.Get("/", index)
// http://localhost:8080
app.Run(iris.Addr(":8080"))
}
func index(ctx iris.Context) {
ctx.View("index.pug")
}