pull/213/head
zhaoshichen 6 years ago
parent 4d47b09111
commit 0d09fc2b9d
  1. 6
      pkg/net/http/blademaster/server.go

@ -177,9 +177,6 @@ func NewServer(conf *ServerConfig) *Engine {
basePath: "/", basePath: "/",
root: true, root: true,
}, },
conf: &ServerConfig{
Timeout: xtime.Duration(time.Second),
},
address: ip.InternalIP(), address: ip.InternalIP(),
trees: make(methodTrees, 0, 9), trees: make(methodTrees, 0, 9),
metastore: make(map[string]map[string]interface{}), metastore: make(map[string]map[string]interface{}),
@ -187,6 +184,9 @@ func NewServer(conf *ServerConfig) *Engine {
HandleMethodNotAllowed: true, HandleMethodNotAllowed: true,
injections: make([]injection, 0), injections: make([]injection, 0),
} }
if err := engine.SetConfig(conf); err != nil {
panic(err)
}
engine.RouterGroup.engine = engine engine.RouterGroup.engine = engine
// NOTE add prometheus monitor location // NOTE add prometheus monitor location
engine.addRoute("GET", "/metrics", monitor()) engine.addRoute("GET", "/metrics", monitor())

Loading…
Cancel
Save