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

NODE_ENV #22

Open
isnotafunction opened this issue Aug 10, 2018 · 0 comments
Open

NODE_ENV #22

isnotafunction opened this issue Aug 10, 2018 · 0 comments

Comments

@isnotafunction
Copy link

isnotafunction commented Aug 10, 2018

You could add your local environment to your start script, just so that it does't throw an error if someone tries to run the server locally without running nodemon

Also, I believe you don't need three links here, unless I'm missing something:

let DB_URL = process.env.SKILLSHARE_DB_URL;
if (process.env.NODE_ENV === "test") {
  DB_URL = process.env.TEST_DB_URL;
} else if (process.env.NODE_ENV === "local") {
  DB_URL = process.env.LOCAL_DB_URL;
}

So I think you can only have the condition that tests if you are in the test environment or in your local environment:

let DB_URL = process.env.YOUR_LOCAL_DB_URL;
if (process.env.NODE_ENV === "test") {
  DB_URL = process.env.TEST_DB_URL;
}

Your heroku db link will only be used to build the database but then you will work on your local database while in development environment

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

No branches or pull requests

1 participant