Consul module for the Hapiness framework.
To get started with consul, you can begin with having a look at the consul official documentation
Table of contents
- Using your module inside Hapiness application
Consulinside your hapiness application
Using your module inside Hapiness application
npm it in your
$ npm install --save @hapiness/core @hapiness/consul rxjsor$ yarn add @hapiness/core @hapiness/consul rxjs
"dependencies":"@hapiness/consul": "^1.0.0""@hapiness/core": "^1.5.1""rxjs": "^5.5.7"//...//...
Consul inside your hapiness application
Import the module
You need to include
ConsulModule in the
imports section of your module definition.
Bootstrap the extension
You need to inject the extension in bootstrap using setConfig to instantiate the module.
The config properties allowed for the extensions are defined like this:
Then just do like this:
Use the exposed service
This library is in fact a wrapper of the famous consul node library but wrap all its functions to returns
You can see the doc by clicking here
We provide a wrapper called
ConsulService exposing a
clientgetter that will allow you to access the consul client.
To set up your development environment:
- clone the repo to your workspace,
- in the shell
cdto the main folder,
npm or yarn install,
npm or yarn run test.
- It will lint the code and execute all tests.
- The test coverage report can be viewed from
|Julien Fauville||Antoine Gomez||Sébastien Ritz||Nicolas Jessel|
Copyright (c) 2018 Hapiness Licensed under the MIT license.