Add default resolver to api router
This commit is contained in:
parent
3ede494945
commit
27eb7db1c2
@ -2,6 +2,7 @@ package router
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"github.com/micro/go-micro/v2/api/resolver"
|
"github.com/micro/go-micro/v2/api/resolver"
|
||||||
|
"github.com/micro/go-micro/v2/api/resolver/vpath"
|
||||||
"github.com/micro/go-micro/v2/registry"
|
"github.com/micro/go-micro/v2/registry"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -23,6 +24,12 @@ func NewOptions(opts ...Option) Options {
|
|||||||
o(&options)
|
o(&options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if options.Resolver == nil {
|
||||||
|
options.Resolver = vpath.NewResolver(
|
||||||
|
resolver.WithHandler(options.Handler),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return options
|
return options
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user