whale-nest-nacos
Version:
If you are a nest micro service architecture, you can use the SDK, so as to realize service discovery based on nacos, distributed load balancing strategy
23 lines • 1.24 kB
JavaScript
;
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNacosConfigClient = void 0;
const NacosConfigService_1 = require("../NacosConfigService");
const getNacosConfigClient = ({ group, serviceName, }) => __awaiter(void 0, void 0, void 0, function* () {
const configClient = new NacosConfigService_1.NacosConfigService({
group,
serviceName,
});
yield configClient.ready();
return configClient;
});
exports.getNacosConfigClient = getNacosConfigClient;
//# sourceMappingURL=getNacosConfigClient.js.map