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: