NestJS · Middle · Question 50 of 75
How do you organize configuration into typed namespaces?
- 1With one big
.envfile read by string keys everywhere - ✓Correct answer: With
registerAs('database', () => ({ ... }))and injectingConfigType<typeof databaseConfig> - 3With global variables
Explanation
Typed config objects avoid typos in key strings and keep related settings together.