So I'm trying to understand how to use .env to secure my api key & data for my login auth. I've followed the process of the dotenv package and the stackoverflow answer here.
What I did:
1. I installed the dotenv package
2. In my rootfolder, I added a .env with only one line:
API_AUTH=http://myapilink.com
3. In my App.js, I added following line:
require('dotenv').config()
console.log(process.env.API_AUTH)
However, console.log returns 'undefined', why is that? What have I missed?