Cvmcosta/ltijs-demo-server

.env setup instructions could be improved

Opened this issue · 2 comments

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"

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
}

I agree. This caught me up as well.