1 Star 0 Fork 0

fengzhitalker / iris

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 735 Bytes
一键复制 编辑 原始数据 按行查看 历史
package main
import (
"github.com/kataras/iris"
)
/*
You need to build the hello.wasm first, download the go1.11 and execute the below command:
$ cd client && GOARCH=wasm GOOS=js /home/$yourname/go1.11/bin/go build -o hello.wasm hello_go111.go
*/
func main() {
app := iris.New()
// we could serve your assets like this the shake of the example,
// never include the .go files there in production.
app.StaticWeb("/", "./client")
app.Get("/", func(ctx iris.Context) {
ctx.ServeFile("./client/hello.html", false) // true for gzip.
})
// visit http://localhost:8080
// you should get an html output like this:
// Hello, the current time is: 2018-07-09 05:54:12.564 +0000 UTC m=+0.003900161
app.Run(iris.Addr(":8080"))
}
Go
1
https://gitee.com/fengzhitalker/iris.git
git@gitee.com:fengzhitalker/iris.git
fengzhitalker
iris
iris
master

搜索帮助