Basic Node: using the .env file not passing

Tell us what’s happening:
I’ve done this test a few times now with different variations on transforming the text into uppercase, and they’ve worked in the app and in my testing (changing the MESSAGE_STYLE environment variable so the text is “Hello json” instead of all uppercase works as intended), but none of them have passed the test in this challenge. I’m not sure why so I’d just like to figure it out.

A link to the /json path:
Thank you!

Your code so far
myApp.js :

if(process.env.MESSAGE_STYLE == 'uppercase'){
app.get("/json", function(req, res) {
  res.json({"message": "HELLO JSON"})
} else{
  app.get("/json", function(req, res) {
    res.json({"message": "Hello json"})



Your browser information:

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

Challenge: Use the .env File

Link to the challenge:

I actually just remixed the project and replaced the MESSAGE_STYLE variable and it passed!

I’ll take a look at your glitch and see if I can help!

1 Like

Thank you! I really appreciate it