Node.js · Middle · Question 58 of 75
What does the Twelve-Factor App recommend for configuration?
- 1Hard-code config per environment in separate branches
- 2Store config in a JSON file committed with the code
- ✓Correct answer: Store config in environment variables, separate from code
Explanation
The same build can then run in staging and production with different settings. Validate the config at startup and fail fast if something is missing.