1、在package.json文件中加入webapi-client的依赖, {"webapi-client":"0.0.3"} 2、在总程序入口配置中间件连接信息 var config = {host: 'localhost', port: 9090, max: 1, idleTimeoutMillis: 5000, log: false}; new (require('../lib/proxy'))(config); 3、在需要用的中间件的地方引入中间件服务,如在controller中引入如下代码 var client = new (require('../lib/proxy'))();//获取中间件的引用 var service = client.getService('UserService');//获取对应的业务服务 4、业务代码无需改动,测试是否通过即可
webapi-client
0.0.4 • Public • PublishedReadme
Keywords
nonePackage Sidebar
Install
npm i webapi-client
Weekly Downloads
1
Version
0.0.4
License
none