I have got the result as per the task but still I can't pass the test

below is my code in order to get the json object to uppercase. but still I cannot pass the test even I got the result. can someone help me please. thanks.

 app.get("/json", (request, response) => {
  if (process.env.MESSAGE_STYLE === "uppercase") {
    response.json({ message: "HELLO WORLD" });
  } else {
    response.json(message);
  }
});

my project link(s)

solution: Glitch :・゚✧

Your browser information:

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

Challenge: Use the .env File

Link to the challenge:

Hi @imangi,
watching the challenge I can see this as requirement:

The response object should either be {"message": "Hello json"} or {"message": "HELLO JSON"} , depending on the MESSAGE_STYLE value.

I think you just need to reword the message to say “HELLO JSON” rather than “HELLO WORLD”.

I hope this helps :sparkles:

1 Like