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

Setting default values if not present in environment #11

Closed
JoeAlamo opened this issue Jan 17, 2018 · 3 comments · Fixed by #39
Closed

Setting default values if not present in environment #11

JoeAlamo opened this issue Jan 17, 2018 · 3 comments · Fixed by #39

Comments

@JoeAlamo
Copy link

Are you able to set default values for the environment variables if they are not present in your environment already, like in Bash?

Or do you recommend we handle this within our code?

@motdotla
Copy link
Owner

motdotla commented Mar 1, 2018

I'm not sure I understand.

If setting in .env file that will become your default value.

But otherwise, if they are not set there or already on your machine, then yes, you will need your code to conditionally generate a default value.

@motdotla motdotla closed this as completed Mar 1, 2018
@jacobrask
Copy link

The suggestion is to allow the syntax WEB_PROXY_PORT=${PORT:-3000}, to set WEB_PROXY_PORT to PORT if it's already defined, otherwise to 3000. Does that make sense?

@vantreeseba
Copy link
Contributor

This will be fixed by #39

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

Successfully merging a pull request may close this issue.

4 participants