I am trying to use the dotenv
NPM package and it is not working for me. I have a file config/config.js
with the following content:
This is how i fix my issue
Intially had this in .env of the root of my project
const db_port = 90101
const db_host="localhost"
const db_username="name"
const db_password="pwd"
const db_name="db"
And all my env variables where undefined.
I fixed it by removing all the const and using just key=value insted of const key="value"
db_port = 90101
db_host=localhost
db_username=name
db_password=pws
db_name=db