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