boot.go 469 B

12345678910111213141516171819202122232425
  1. package boot
  2. import (
  3. "github.com/gogf/gf/frame/g"
  4. "github.com/gogf/gf/net/ghttp"
  5. "github.com/gogf/gf/os/glog"
  6. )
  7. // 用于配置初始化.
  8. func init() {
  9. glog.Info("########service start...")
  10. v := g.View()
  11. c := g.Config()
  12. s := g.Server()
  13. // 配置对象及视图对象配置
  14. c.AddPath("config")
  15. v.AddPath("template")
  16. glog.SetStdoutPrint(true)
  17. s.SetNameToUriType(ghttp.URI_TYPE_ALLLOWER)
  18. glog.Info("########service finish.")
  19. }