simple file-based default configuration manager for using docker's data volume
var defaultjs = require('default.js');
var serverConfigManager = new defaultjs(
'./config/defaultConfig.json',
'./config/userConfig/serverConfig.json');
var serverConfig = serverConfigManager.readConfigsSync();
console.log(serverConfig.somefield);
- initSync()
- init()
- copyDefaultSync()
- copyDefault()
- readConfigsSync()
- readConfigs()
- setConfigSync()
- setConfig()
- setConfigsSync()
- setConfigs()
validate current configuration file
and initialize new configuration
validate current configuration file
and initialize new configuration
callback(error, data)
copy defaultConfigFile to userConfigFile
copy defaultConfigFile to userConfigFile
callback(error, data)
read configuration from userConfigFile
return : configuration json
Example:
read configuration from userConfigFile
-
callback(error, data)
- parameters
- error
- data : configs json
- parameters
set key-value configuration to userConfigFile
set key-value configuration to userConfigFile
callback(error)
Example :
set json configuration set to userConfigFile
set json configuration set to userConfigFile
callback(error)
Example :
make a user-config file from the default-configuration file
docker run -ti (imageName) -v CustomConfigurationFilePath(host):userConfigPath(in the container)
Copyright 2016 Noizbuster <noizbuster@noizbuster.com>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at