mirror of
https://github.com/kataras/iris.git
synced 2025-01-23 18:51:03 +01:00
0d26f24eb7
Former-commit-id: d20afb2e899aee658a8e0ed1693357798df93462
24 lines
405 B
Go
24 lines
405 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.Listen(":8080")
|
|
}
|
|
|
|
func index(ctx iris.Context) {
|
|
ctx.View("index.pug")
|
|
}
|