1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-03-17 21:07:54 +02:00

Merge pull request #214 from bilibili/cfg

fix config set
This commit is contained in:
Tony 2019-07-18 11:48:47 +08:00 committed by GitHub
commit 77b3a80d94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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