2018-05-26 21:49:48 +02:00
|
|
|
package main
|
|
|
|
|
2019-10-25 00:27:02 +02:00
|
|
|
import "github.com/kataras/iris/v12"
|
2018-05-26 21:49:48 +02:00
|
|
|
|
2020-02-14 22:34:56 +01:00
|
|
|
// $ go get -u github.com/go-bindata/go-bindata/...
|
|
|
|
// $ go-bindata ./templates/...
|
|
|
|
// $ go build
|
2018-05-26 21:49:48 +02:00
|
|
|
func main() {
|
|
|
|
app := iris.New()
|
|
|
|
|
2020-02-14 22:34:56 +01:00
|
|
|
tmpl := iris.Pug("./templates", ".pug").Binary(Asset, AssetNames)
|
2018-05-26 21:49:48 +02:00
|
|
|
|
|
|
|
app.RegisterView(tmpl)
|
|
|
|
|
|
|
|
app.Get("/", index)
|
|
|
|
|
|
|
|
// http://localhost:8080
|
2020-03-05 21:41:27 +01:00
|
|
|
app.Listen(":8080")
|
2018-05-26 21:49:48 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func index(ctx iris.Context) {
|
|
|
|
ctx.View("index.pug")
|
|
|
|
}
|