Basic Node and Express - Use the .env File

Tell us what’s happening:
So, I’ve been trying to figure this out for 2 hours already. I seem to have an issue, and it appears like when I click “I’ve completed this challenge” I get this error:
// running tests The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE // tests completed

What’s weird is that, even I tried to console.log, when I manually type the replit url with /json into my browser, I can see the log, but it doesnt log when I try from the free code camp website instead freecodecamp . org is logged.

Your project link(s)

solution: boilerplate-express (1) - Replit

Your browser information:

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

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

Link to the challenge:

Not sure why, but if I fork your Replit and add the environment variable it passes the test for me.

So I’m thinking maybe you didn’t add it correctly although in the image it looks OK. Click the Edit as JSON button under the Secrets and show me what it looks like.


Maybe, try forking your own Replit and give that a try as well.

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