Basic Node and Express - Use the .env File not passing the test

Tell us what’s happening:
I’m trying to complete the ‘Use the .env File’ test, and i think i did it all right, but for some reason it is not working at all. I’ve already looked in this forum and i noticed that i did all that was recommended to me. Please, help.

Your project link(s)

solution: boilerplate-express - Replit

Your browser information:

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

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

Link to the challenge:

the problem is the location of this line:
const MESSAGE_STYLE = process.env[‘MESSAGE_STYLE’];

if you read the exercise description again it says:
Note that you must read the value of process.env.MESSAGE_STYLE inside the route handler, not outside of it, due to the way our tests run.

1 Like

Thank you! It worked!

1 Like