I have my create-react-app with Express running perfectly fine on localhost but now that I want to publish it I need to move some stuff to environment variables obviously.
The thing is that I created my .env
file in my /src
folder (I can't move it to the root directory if I want to be able to access to it from my /src
) and named variables with the REACT_APP_ prefix, like:
REACT_APP_USERNAME="TESTNAME"
I'm getting that .env
file with
const myEnv = require('../.env')
Then in one of my components I try to get that variable but it´s not there... if I console.log(proccess.env)
I can see the default values but nothing about my vars, what am I missing?