1 Star 2 Fork 0

api-go/iris

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 602 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"github.com/kataras/iris"
)
func main() {
app := iris.New()
// $ go get -u github.com/jteeuwen/go-bindata/...
// $ go-bindata ./templates/...
// $ go build
// $ ./embedding-templates-into-app
// html files are not used, you can delete the folder and run the example
app.RegisterView(iris.HTML("./templates", ".html").Binary(Asset, AssetNames))
app.Get("/", hi)
// http://localhost:8080
app.Run(iris.Addr(":8080"))
}
type page struct {
Title, Name string
}
func hi(ctx iris.Context) {
ctx.ViewData("", page{Title: "Hi Page", Name: "iris"})
ctx.View("hi.html")
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/netscript/iris.git
git@gitee.com:netscript/iris.git
netscript
iris
iris
v8.4.3

搜索帮助