Use the .env File with stuck

Tell us what’s happening:
Describe your issue in detail here.
My code seems to be working I’ve tested it in the terminal using httpie and I get the correct result, however when I try to submit it to freecodecamp I get errors.

Your project link(s)

solution: FCC-Basic-Node-and-Express - Replit

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36

Challenge: Use the .env File

Link to the challenge:

I can’t see your code in the repl link you provided.

does this link work?

const mySecret = process.env['MESSAGE_STYLE'];

The tests work by changing the value of this environment variable while the test is running, but here you have this variable in the global space, which means the environment variable is only checked once, when your app starts.

thank you this worked :slight_smile:

1 Like

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