How do I override all config files with a custom name #767
-
|
Hi All Thanks for creating an efficient module to load the config files. Application ships with default.json and production.json located in ./config folder. I need to override these values with /user/override.json file. How do I achieve this? I found NODE_CONFIG_DIR to put all config folders. How do I mention the file name as override.json as the top override file. Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
For dev environments I like to use a symlink but I suspect what youβre asking is how do I install an app and allow individual users to override a property? If you canβt think of another way to do this (eg, if itβs one or two values value NODE_CONFIG may suffice) NODE_CONFIG_DIR can contain a comma separated list of locations. Itβs not advertised terribly loudly in the docs because itβs not the first thing one should try, but there are tests that assert it as a feature, and it is not on the deprecation list. If I were you I would build this stapling process into the bootstrapping code of your application, to set both the appβs config directory and the one in $HOME at the same time. |
Beta Was this translation helpful? Give feedback.
For dev environments I like to use a symlink but I suspect what youβre asking is how do I install an app and allow individual users to override a property? If you canβt think of another way to do this (eg, if itβs one or two values value NODE_CONFIG may suffice)
NODE_CONFIG_DIR can contain a comma separated list of locations. Itβs not advertised terribly loudly in the docs because itβs not the first thing one should try, but there are tests that assert it as a feature, and it is not on the deprecation list. If I were you I would build this stapling process into the bootstrapping code of your application, to set both the appβs config directory and the one in $HOME at the same time.