mirror of
https://github.com/kataras/iris.git
synced 2025-01-24 03:01:03 +01:00
c13fd84354
Former-commit-id: 617f64d061e88f050a443ea1751fa244164656c5
24 lines
413 B
Go
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")
|
|
}
|