You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A parameter is mandatory to get a specific field of the config.
Replication/Example
I defined my config as a complex object with fields being sub-objects, etc.
and need to provide that object to another party (a database, some service, the frontend, whatever).
Today:
config=serviceConfig.get()
is not allowed.
and I'm constrained to break encapsulation by doing:
config=serviceConfig['internalConfig']
The text was updated successfully, but these errors were encountered:
Hmmmm, this is not something that exists in the latest version, 1.4.7 or the next version ^2.0.0.
Could you provide an example of how you're structuring your config object please? nestjs-config started out as a 'laravel-like' config folder/file structure. So database config goes into a database.ts file and to get that config you use config.get('database') which would return the export object/class from database.ts.
Version ^2.0.0 currently only uses export default to add config to the config service. I have been thinking about enabling all exports which sounds similar to your request? But not completely.
Let me know how you're expecting to use the package and I'll see if it's possible to tweek.How comes you're using version 0.5.0 though?
It's a pretty standard pattern for an app to log out its config when it bootstraps itself. I don't know Jerome's use case, but mine is pretty simple, in our configureApp() method:
Alternatively, if you had a method in ConfigService that returned the available configuration namespaces as an array, I could then do the dump by walking the namespaces returned.
Issue type:
nestjs-config version
0.5.0
@nestjs/common+core or other package versions
Excepted behavior
serviceConfig.get()
returns root/whole config object.Actual behavior or outcome (for issue)
A parameter is mandatory to get a specific field of the config.
Replication/Example
I defined my config as a complex object with fields being sub-objects, etc.
and need to provide that object to another party (a database, some service, the frontend, whatever).
Today:
is not allowed.
and I'm constrained to break encapsulation by doing:
The text was updated successfully, but these errors were encountered: