Node.js · Junior · Question 75 of 75

Why should secrets like database passwords not be hard-coded in the source?

Explanation

A secret committed once stays in git history. Keep .env files out of git and rotate any secret that was ever committed.

Further reading

Problem with a question

Node.js · Junior · question 75

Test yourself

Take the Node.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz