1.0.1 • Published 7 years ago

koa-devstack-config-client v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
7 years ago

= DevStack Configuration Client

Koa middleware that revocery the properties of a configuration service.

== Usage

Nowadays is really common have the configuration of your application externalized, so with this middleware you can recover in json format your properties from a configuration service as the configuration service of Spring framework.

=== Configuration

Before use the koa-devstack-config-client is necessary configurate the file configuration.json, this file will be in the root of your application:

. Url of the configuration service. . Label of the application. . Name, application name. . Profile of your application. . Attempts, number of attempst in case the connection with the service fail. . Delay, time between attempts. . Logging, level of the logging.

source,json

{ "configService":{ "url":"https://configuration-va-vaserv-pre.appls.boae.paas.gsnetcloud.corp:443", "label":"master", "name":"alarms", "profile":"default", "attempts":3, "delay":5000 }

}

=== When do the library return an 405, Method not allowed ?

. If service is down. . If the url is bad formatted.

=== Retrieving the property

If you want recover a property you have to pass it as parameter.

== Example

* var koa = require('koa');
* var configClient = require(koa-devstack-config-client);
* var app = new koa();
* app.use(configClient());
* configClient.property('serenity.devstack.audience');

== Additional Information If you want to use this library, you need at least node v.7 and Harmony.