0.0.9 • Published 7 years ago

xyj-service-locator v0.0.9

Weekly downloads
7
License
MIT
Repository
github
Last release
7 years ago

service-locator

Build Status

service locator to seneca client,主要功能单独实例一次seneca-client,服务有则从map中取,无则从config取参数实例化返回,添加进map中,config没有则报错

Install

$ npm install xyj-service-locator --save

Usage

const Locator = require('service-locator');
const config = {
    "service1": {
        "port": 10001,
        "host": "localhost"
    },
    "service2": {
        "port": 10002,
        "host": "localhost"
    }
}
let serviceLocator = new Locator(config);

let service1 = serviceLocator.get("service1");

Test

$ mocha

License

@MIT

0.0.9

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago