【文件属性】:
文件名称:node-consul:提供基于 Consul 的服务发现
文件大小:189KB
文件格式:ZIP
更新时间:2021-08-04 13:48:33
team-members type-oss-node-module JavaScript
@sealsystems/领事
@sealsystems/consul 提供基于 Consul 的服务发现。
安装
npm install @sealsystems/consul
快速开始
首先,您需要在应用程序中添加对 @sealsystems/consul 的引用。
const consul = require ( '@sealsystems/consul' ) ;
然后调用connect向 Consul 注册您的服务。
await consul . connect ( {
id : 'my-service-id' ,
name : 'my-service-name' ,
serviceUrl : 'http://localhost:3000' , // URL of my service
consulUrl : 'http://localhost:8500