Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config should not require a path #152

Open
genu opened this issue Jan 8, 2020 · 3 comments
Open

Config should not require a path #152

genu opened this issue Jan 8, 2020 · 3 comments
Assignees

Comments

@genu
Copy link
Contributor

genu commented Jan 8, 2020

This is more design related.

Current behavior is that you must pass an env file to load through the path property.

However, in a production environment, it is recommended that the .env NOT be committed to the repository, as per https://github.com/motdotla/dotenv#should-i-commit-my-env-file

we're using dotenv() under the hood, so I think that there should be a fall back case where if there is no path that is passed in, dotenv should just load the env variables directly from the system (which is the recommended way, anyway).

Any thoughts?

@rubiin
Copy link
Member

rubiin commented Jan 17, 2020

Env files are not commited to repo rather created or supplied from another source.

@genu
Copy link
Contributor Author

genu commented Jan 17, 2020

The current flow is that the .env files are required to be passed in though, is it not?

If you don't pass an .env file to the EasyConfig Module, it will throw an error.

@rubiin rubiin self-assigned this Jan 22, 2020
@rubiin rubiin closed this as completed Jul 10, 2020
@rubiin rubiin reopened this Jul 10, 2020
@btd1337
Copy link

btd1337 commented Mar 22, 2023

The expected operation is that if the .env file isn't present, the library will try to access the host's environment variables.

This is how nestjs-config works.

Currently this library does not work in production!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants