Use the .env File: working on my PC, but not passing FCC tests

Tell us what’s happening:

Hello,

My code works just fine on my computer but for some reason is not passing FCC test cases. I tried it different ways, but always get this message:

" // running tests The response of the endpoint

/json

should change according to the environment variable

MESSAGE_STYLE

// tests completed

The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE"

Your code so far
1) I have created .env file where I stored MESSAGE_STYLE variable with “uppercase” value
2) I have wrote the following code:

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

Here is my Glitch Project

Am I doing something wrong or it might be a bug in FCC’s test cases?

Your browser information:

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

Challenge: Use the .env File

Link to the challenge:

How would I do it?

Is it by indicating app.listen( 3000 ); at end of myApp.js file?

That 3000 is the port number!

So where would I need to supply that port number to run the cases locally?

Is there a way to not use Glitch? I’m putting studying API & microservice module on hold. :neutral_face:.