mirror of
https://gitee.com/johng/gf.git
synced 2024-11-30 03:07:45 +08:00
go.mod updates; add search path configuration in file for package ghttp.Server
This commit is contained in:
parent
36403fdc08
commit
52943b283c
1
go.mod
1
go.mod
@ -5,7 +5,6 @@ go 1.11
|
||||
require (
|
||||
github.com/BurntSushi/toml v0.3.1
|
||||
github.com/clbanning/mxj v1.8.4
|
||||
github.com/denisenkom/go-mssqldb v0.0.0-20200206145737-bbfc9a55622e // indirect
|
||||
github.com/fatih/structs v1.1.0
|
||||
github.com/fsnotify/fsnotify v1.4.7
|
||||
github.com/gf-third/mysql v1.4.2
|
||||
|
@ -11,6 +11,8 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/debug/gdebug"
|
||||
"github.com/gogf/gf/internal/intlog"
|
||||
"github.com/gogf/gf/util/gutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"reflect"
|
||||
@ -338,7 +340,10 @@ func (s *Server) Start() error {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
if intlog.IsInGFDevelop() {
|
||||
intlog.Print("server configuration:")
|
||||
gutil.Dump(s.config)
|
||||
}
|
||||
s.dumpRouterMap()
|
||||
return nil
|
||||
}
|
||||
|
@ -139,6 +139,13 @@ func (s *Server) SetConfig(c ServerConfig) error {
|
||||
if c.ServerRoot != "" {
|
||||
s.SetServerRoot(c.ServerRoot)
|
||||
}
|
||||
if len(c.SearchPaths) > 0 {
|
||||
paths := c.SearchPaths
|
||||
c.SearchPaths = []string{}
|
||||
for _, v := range paths {
|
||||
s.AddSearchPath(v)
|
||||
}
|
||||
}
|
||||
// HTTPS.
|
||||
if c.TLSConfig == nil && c.HTTPSCertPath != "" {
|
||||
s.EnableHTTPS(c.HTTPSCertPath, c.HTTPSKeyPath)
|
||||
|
Loading…
Reference in New Issue
Block a user