I declared variables in a file named .env
MONGOCONNECTIONSTRING=connectionstring
when I run heroku local web it says
[OKAY] Loaded ENV .env File as KEY=VALUE Format
I am trying to use the environment variables like this
const connectionString = process.env.MONGOCONNECTIONSTRING
in my index.js file
when I try to print the variable connectionstring it is undefined. How do I access the variables.
Heroku's best practices say to do that however I must be missing something since the variables are never available.