Replies: 3 comments
-
I want to get rid of -> |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
While working on a PR for #990, I stumbled upon an issue with config parameter. Right now there are at least two ways used to access the configuration:
_.get(config, 'param_name', default_param)
config.param_name
The config object is passed through functions and there is no clear way to know the full configuration other than exploring the code (for example:
_.get(config, 'web.title') ? config.web.title : WEB_TITLE)
).This may also cause issues when the same configuration value is retrieved from two different scripts.
Describe the solution you'd like
I think configuration should be centralized, maybe using a module like https://www.npmjs.com/package/config . This would allow to have a single point of entry for all the defaults and for the full config declaration, multiple configuration env-dependant (maybe not needed, but you never know), environment variables handling (useful for example for Docker).
I know that this would be a major change but it would definitely improve handling and management, since config would be a "singleton" and there wouldn't be the need to pass it as a parameter in inner functions.
Beta Was this translation helpful? Give feedback.
All reactions