auto_discovery
Sample and Lib for service auto discovery
Last updated 2 years ago by thirstyzlx .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install auto_discovery 
SYNC missed versions from official npm registry.

autoDiscoverySample

In microservice world, enable new services without changing configs on the existing services. No configuration, and auto discovery new services.

Requirement:

  • A Redis Server
  • Node.js (express)

How To:

AutoDiscovery_sample.js is a sample

  1. npm install -save auto_discovery
  2. In code:
    const AutoDiscovery = require('auto_discovery');
  3. Create an express server:
    express = require('express');
    app = express();
    PORT= 3000;
  4. Create an object contains the service info:
    myConfig = {name: NAME, content: {url: "http://localhost:3000", endpoints: {a: "/endpoint_a", b: "/endpoint_b", ...}}};
  5. Create redis info:
    redisUrl = "localhost";
    redisPort = "6379";
  6. Create autoDiscovery Instance:
    AutoConfigs = new AutoDiscovery(myConfig, {url: redisUrl, port: redisPort}, {server: app, port: PORT}, null);

Any services using the same Redis Server will be enable with auto-discovery feature. Save time for configuration management, extra deployments.

Current Tags

  • 0.0.2                                ...           latest (2 years ago)

3 Versions

  • 0.0.2                                ...           2 years ago
  • 0.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 6
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |