README
Sidecare
JavaScript sidecar helper for communicating with a Prana style sidecar app
Usage
npm install @aftonbladet/sidecare --save
Configuration
To get a configuration value from the configuration server:
import get from '@aftonbladet/sidecare';
(async () => {
console.log('Configuration value for "foo.bar"', await get('foo.bar'));
})();
The key passed along to get
will be translated into an environment variable by replacing all .
s with _
s
and uppercasing it (e.g FOO_BAR
). If the environment variable is not found the configuration server value with
the exact key (e.g foo.bar
) will be returned. If no configuration is found, undefined
is returned. Environment
variables wrapped in brackets will be converted to arrays (split by comma).
It will use the environment variable BOXFUSE_APP
as service and BOXFUSE_ENV
as profile (along with default
.
Developing
- Optional step (if not logged in already):
./npm login --registry=https://registry.npmjs.org/ --scope=@aftonbladet
- username is
aftonbladet
- password can be found in https://password.int.aftonbladet.se:1583/PassTrixMain.cc (search for
npm
) - email is
tobias.jarlund@aftonbladet.se
- username is
npm install
Release and Publish
Every push to master will result in a new patch release being tagged and published on npmjs.org.
If you want to bump the minor or major version, just use the npm version
command as you please.
The version will be tagged and pushed automatically and Travis will publish it on npmjs.org.
E.g if you are on version 1.0.4 and run:
npm version minor
Travis will publish 1.1.0 on npmjs.org for you.