Files
gf/geg/other/test.go
2018-04-18 23:01:48 +08:00

20 lines
472 B
Go

package main
import (
"gitee.com/johng/gf/g/net/ghttp"
"gitee.com/johng/gf/g/frame/gins"
)
func main() {
s := ghttp.GetServer()
s.BindHandler("/template2", func(r *ghttp.Request){
tplcontent := `id:{{.id}}, name:{{.name}}`
content, _ := gins.View().ParseContent(tplcontent, map[string]interface{}{
"id" : 123,
"name" : "john",
})
r.Response.Write(content)
})
s.SetPort(8199)
s.Run()
}