S
S
szQocks2021-06-12 15:07:41
React
szQocks, 2021-06-12 15:07:41

Why is the .env file needed?

In Google, I have already read, in principle, they write that for storing variables and their values.
I do not fully understand what is the benefit of this file with variables. Does this file serve as protection or just for convenience? I will be glad to any answers.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergio, 2021-06-12
@szQocks

.env files usually contain environment variables, and for different environments like dev, production, staging, different files can be created. Also, each of the developers can change the variables on the local system for themselves at their discretion.
In general, env files serve to isolate an application from the environment in which it runs. Some kind of configuration abstraction.
For example, it usually stores all sorts of API keys and other passwords that developers do not want to stick into the code (for privacy purposes, for example, if the project is open-source and all the code is uploaded to GitHub).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question