1.0.3 • Published 6 years ago

vasco v1.0.3

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

node-vasco

Service Discoverer node module

Install

npm install vasco

Usage

Inside package.json of a new service module:

    "name": "user-api",                 // name of service
    "version": "v1.0.1",                // version of service
    "vasco": {                          // vasco configuration
        "dependencies": {               // dependencies of service
            "accounts-api": "v3.0.0",   // name and version of dependency
            "auth": "v1.0.0"
        },
        "mocks": {
            "auth": "localhost:3000"    // dependency mocked with given url
        }
    }

Now, inside app.js (or another entrypoint):

var vasco = require('vasco');
vasco.register(selfUrl, require('./package'), (err, deps) => {
  if (err) {
    // some error happened in registering self or getting dependency urls
    throw err;
  }
  // deps is a hash of dependency name:version mapped against their urls
  console.log(deps);
});

where selfUrl is the URL (typically <ip>:<port>) that you want this service to be registered against.

Then, start the service command prompt:

VASCO_URL=127.0.0.1:6379 node app.js

If not supplied, VASCO_URL gets the default value 127.0.0.1:6379, ideal for development.

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago