Basic Node and Express - Use the .env File

I’m using replit for the challenges and I’m having trouble with accessing my env data. I’ve tried adding the variable inside the function also globally but it doesn’t seem to work. I tried console logging the MESSAGE_STYLE but it returns undefined, also can’t find in env object. Please help

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Basic Node and Express - Use the .env File

Link to the challenge:

To acces to this variable in replit you have to go to the secret section and add it there, be sure to be in the app file, add the secret in the field add new secret and then puss insert secret

Thanks, deleted the old secret and created a new one. For so reason it works now and I had to declare the secret in the function call

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.