Socket
Socket
Sign inDemoInstall

cds-discover

Package Overview
Dependencies
42
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cds-discover

discover power by cds


Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Install size
2.23 MB
Created
Weekly downloads
 

Readme

Source

TuRing-CDS

cds-discover

npm install cds-discover --save

去中心化服务集群

Example

const Discover = require('cds-discover');

const discover = new Discover();

disconver
    //本地服务监听端口
    .listen(9004)
    //尝试连接到 discover.cavacn.com 根服务器,当然你也可以是  localhost
    //为什么要这个,因为你肯定需要一个领路人,要不然你无法加入这个圈子
    .tryConnect(9004,'discover.cavacn.com');
discover.on('init',()=>{
    //初始化完成之后
    let serviceName = 'YourServiceName';
    let serviceConfig = 'YourServiceConfig'
    //把service注册到  服务集群中
    discover.addService(serverName,serverConfig);
});

discover.watch('你需要监听的service  , . 通配所有',(method,serviceName,config)=>{
    console.log('watch',method,serviceName,config);
});

FAQs

Last updated on 13 Mar 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc