Tell us what’s happening:
Tests ain’t passing in FCC.
Error code: The response of the endpoint /json
should change according to the environment variable MESSAGE_STYLE
, tried everything. Actually it returns what it should, don’t know where the mistake is.
Edit: Yesterday I passed it without any problem (I lost my glitch link), today I wanted to repeat and… Actually I can’t pass it.
Your code so far
app.get("/json", (req, res) => {
let response;
if (process.env.MESSAGE_STYLE !== "uppercase") {
response = "Hello json";
} else {
response = "Hello json".toUpperCase();
}
res.json({ message: response });
});
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: