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

.env setup instructions could be improved #6

Open
miguelhughes opened this issue Jan 20, 2021 · 2 comments
Open

.env setup instructions could be improved #6

miguelhughes opened this issue Jan 20, 2021 · 2 comments

Comments

@miguelhughes
Copy link

As a newcomer to node & express, I was not familiar with the .env files and misunderstood the readme instructions.
The setup instructions state: "Setup .env file with the relevant variables"
I thought this meant to just put my values in example.env. But "example.env" is not automatically picked up by the code as is, it also needs to be renamed to ".env".

I would suggest editing the readme to reflect this, adding an explicit step of:
rename "example.env" to ".env"

@miguelhughes
Copy link
Author

miguelhughes commented Jan 20, 2021

Alternatively, we could throw an error if the .env file isn't found; changing the first in index.js to:

const result =require('dotenv').config()

if (result.error) {
  throw result.error
}

@douglundin
Copy link

I agree. This caught me up as well.

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

2 participants