[Question] load config files from multiple sources
See original GitHub issueDear all,
thank you very much for this nice package. I am quite new to TypeScript - therefore, this might be a stupid question. Anyway, I am going for this 😆
Consider the following scenario (folder structure):
src
app
modules
cat
config
cat-config.ts
customconfig.ts
whatever.ts
dog
config
dog-config.ts
snake
config
snake-config.ts
config
app.ts
database.ts
filesystem.ts
Basically, i would like to load all config files which are scattered around my application. Basic config files, like the app.ts
or database.ts
are stored in the src/app/config
folder, whereas “domain specific” config files are located within their own module folder (e.g., the cat
module has its configuration stored in src/app/modules/cat/config/cat-config.ts
Upon start of the application, i would like to get and merge all config files together, so i can use config.get('cat-config.deeply.nested.value');
to access specific values.
How can i manage to solve this?
All the best
Issue Analytics
- State:
- Created 5 years ago
- Comments:27 (11 by maintainers)
@eugenchio There is now a ‘modifyConfigName’ options that you can pass in.
I’ve noticed this isn’t actually in the readme 👎 so I’ll add an issue for that now
I’ve opened #57 for the merge/immutable. I’ve also opened a PR for modifyConfigName method to be added to the readme https://github.com/nestjs-community/nestjs-config/tree/feature/modify-name-readme#multi-modular-config-usage