NestJS · Junior · Question 14 of 75

What is a typical way to load environment configuration in Nest?

Explanation

forRoot loads .env and can validate variables with a schema. isGlobal: true makes ConfigService available everywhere.

Further reading

Problem with a question

NestJS · Junior · question 14

Test yourself

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

Take this quiz