@jswork/hot-config-service
v1.0.4
Published
A lightweight JavaScript class for dynamic configurations.
Downloads
9
Readme
hot-config-service
A lightweight JavaScript class for dynamic configurations.
installation
npm install @jswork/hot-config-service
usage
import HotConfigService from '@jswork/hot-config-service';
const hotConfig = new HotConfigService({
envs: {
'beta': 'https://student-api.beta.saybot.net',
'production': 'https://student-api.alo7.com'
},
env: 'beta',
subpath: '/api/v2/configurations/'
});
// setOptions
hotConfig.setOptions({ env: 'production' });
// fetch
await hotConfig.fetch();
// get value
hostConfig.get('env');
types
/// <reference types="@jswork/hot-config-service/global.d.ts" />
license
Code released under the MIT license.