Use the .env File: code works but fails FCC test

My code works on Glitch but does not pass the FCC solution test.

Is my code basically wrong?

app.get("/json", function(req, res) {
  process.env.MESSAGE_STYLE == "uppercase" 
  ? res.json({"message": ("Hello Json").toUpperCase()}) 
  : res.json({"message": "Hello Json"})

Nope, it’s basically right. Remember that the original object was {"message": "Hello json"}, so your new code needs to switch from that to upper case.

1 Like