cloud-config-client-observable
v1.0.0
Published
Spring Cloud Config Client for NodeJS
Downloads
5
Maintainers
Readme
Spring Cloud Config Client for NodeJS
Requires: NodeJS 4+
Feature requests are welcome.
This proejct is based on Víctor Herraiz Posada's cloud-config-client version 0.3.1.
All original features are compatible, plus the observe
method that retuns a observable factory for properties.
Install
npm install cloud-config-client-observable --save
Usage
const client = require("cloud-config-client-observable");
const obs = client.observe({
application: "invoices"
});
obs.create("this.is.a.key")
.subscribe(value => console.log(`The value is ${value}`));
Please, check the examples folder for more examples.
Parameters:
- options (object, mandatory):
endpoint
(string, optional, default:http://localhost:8888
): Config server URLinterval
(integer, optional, default: 30000): The interval for updating properties.application
(deprecated: use name): Load configuration for this appname
(string, mandatory): Load the configuration with this nameprofiles
(string array, optional, default:["default"]
)label
(string, optional)auth
(object, optional): Basic Authentication for access config server (e.g.:{ user: "username", pass: "password"}
).endpoint
accepts also basic auth (e.g.http://user:pass@localhost:8888
)user
(string)pass
(string)
- cb (function, optional): node style callback, if missing the method will return a promise.
References
- Spring Cloud Config Client for NodeJS: Original project.
- Spring Cloud Config