-
Notifications
You must be signed in to change notification settings - Fork 3
✨ Increased transparency by always using env var names #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
8bddb7e to
efa9722
Compare
a625585 to
8a6ef11
Compare
49904c4 to
72705f4
Compare
400e880 to
6fdd21c
Compare
|
Things to consider - Change of the API and using recursive object traversal should be okay for config files, but it also increases complexity of the library. For example checking nested fields is now done on the whole object if the function is |
wiki/advanced-usage.md
Outdated
| ### Reloading the config | ||
|
|
||
| If you are working in an environment that is able to change the configuration during runtime, `reload` | ||
| function can be helpful to load a new configuration based on same settings and schema as the previous one. | ||
|
|
||
| ```typescript | ||
| import { createLoader, schema } from 'configuru' | ||
| const loader = createLoader() | ||
|
|
||
| const configSchema = loader({ | ||
| canChange: schema.string('CHANGEABLE'), | ||
| }) | ||
|
|
||
| const { canChange } = configSchema.values() // old value | ||
|
|
||
| // value changed in config file or env variables during runtime | ||
|
|
||
| const { canChange } = configSchema.reload().values() // new value |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Super cool feature to keep the config up to date, however nothing to do with the original issue #52, different PR for such a huge feat. would make more sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved to #63
cba5026 to
a1fd713
Compare
a1fd713 to
e619222
Compare
PR addresses:
SERVER_PORT: schema.string()reloadfunction for automatic config reload based on previous settingsNew example usage viz docs.
Fixes #52
REDMIME-96040