S
S
Space2018-02-10 18:54:43
Web development
Space, 2018-02-10 18:54:43

Can .env be used in production?

Laravel always uses .env, it stores, for example, accesses to the database. Now nodejs is also connected and I don’t want to write a connection to the database in a regular script. I found a solution https://github.com/bkeepers/dotenv, there is a special library for this. But for some reason already in the second article they write that you can only use development, but not for production.
Can anyone explain why?
Here is an example material

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex Wells, 2018-02-10
@ruslite

.env file is not loaded into git. That's why he and env (environment - environment), which would each time configure it for the desired environment. So it is also used in sales.
"It is important to remember that this setup should only be used for development. For production you should still set your environment variables in the standard way," the article says. Read to the end) the standard way = .env

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question