github.com/gogf/gf@v1.16.9/.example/os/gview/hot_update/web_hot_update.go (about)

     1  package main
     2  
     3  import (
     4  	"github.com/gogf/gf/frame/g"
     5  	"github.com/gogf/gf/net/ghttp"
     6  )
     7  
     8  func main() {
     9  	s := g.Server()
    10  	s.BindHandler("/", func(r *ghttp.Request) {
    11  		g.View().SetPath(`D:\Workspace\Go\GOPATH\src\gitee.com\johng\gf\geg\os\gview`)
    12  		b, _ := g.View().Parse("gview.tpl", nil)
    13  		r.Response.Write(b)
    14  	})
    15  	s.Run()
    16  }