0.2.0 • Published 8 years ago

mumba-microservice-config v0.2.0

Weekly downloads
-
License
Apache-2.0
Repository
gitlab
Last release
8 years ago

Mumba Config Microservice Module

Provide configuration support for a Microservice.

Configuration

This module requires that a Config object has been registered as config.

PropertyTypeDescription
vault:hoststringThe hostname for the Vault server.

DI Container

This module adds the following container artifacts if they don't already exist.

NameTypeDescription
configConfigAn instance of a mumba-config object.

The following container artifacts may be provided by the user.

NameTypeDescription
defaultConfigobjectAn optional object that you provide representing the default configuration for a Config object. It must exist prior to the first initialisation of the Config object otherwise the vaules will not be injected.

Installation

$ npm install --save mumba-microservice-config
$ typings install -—save dicontainer=npm:mumba-typedef-dicontainer

Examples

const Sandal = require("sandal");
import {DiContainer} from "mumba-typedef-dicontainer";
import {MicroserviceConfigModule} from "mumba-microservice-config";

let container: DiContainer = new Sandal();

// Set the default configuration.
container.object('defaultConfig', {
	foo: 'bar'
});

// Register the module.
MicroserviceConfigModule.register(container);

container.resolve('config', (err: Error, config: Config) => {
	if (err) {
		throw err;
	}

	let foo = config.get('foo'); // "bar"
});

Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install
$ npm test

People

The original author of Mumba Config Microservice Module is Andrew Eddie.

List of all contributors

License

Apache 2.0


© 2016 Mumba Pty Ltd. All rights reserved.

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago