Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async init() {
this.nacosClient = new NacosNamingClient({
...this.nacosConfig,
logger: this.logger,
namespace: 'public',
});
await this.nacosClient.ready();
// 这里的服务名请从 nacos 服务上找
this.nacosClient.subscribe('nacos.test.3', hosts => {
console.log('-----------naming result start --------------');
console.log(hosts);
console.log('-----------naming result end--------------');
});
}