nats discovery

This commit is contained in:
mr 2024-10-17 16:51:37 +02:00
parent 73fce1d8fb
commit 56f81fb30e

View File

@ -94,7 +94,7 @@ func (a *API) SubscribeRouter(infos []*beego.ControllerInfo) {
for k := range info.GetMethod() { for k := range info.GetMethod() {
methods = append(methods, k) methods = append(methods, k)
} }
path := strings.ReplaceAll(info.GetPattern(), "/oc", "/"+strings.ReplaceAll(config.GetAppName(), "oc-", "")) path := strings.ReplaceAll(info.GetPattern(), "/oc/", "/"+strings.ReplaceAll(config.GetAppName(), "oc-", ""))
discovery[path] = methods discovery[path] = methods
} }
nats.SetNATSPub("api", DISCOVERY, discovery) nats.SetNATSPub("api", DISCOVERY, discovery)