Tell us what’s happening:
My code can’t seem to pass the test case. Even though the correct output is being shown at the ‘/json’ endpoint. Any help?
This the code:
app.get(“/json”,(req, res) => {
mySecret = process.env.MESSAGE_STYLE
if( process.env.MESSAGE_STYLE == “uppercase”){
message = “Hello Json”.toUpperCase();
res.json({message})
}
else if( process.env.MESSAGE_STYLE != “uppercase”){
message = “Hello json”;
res.json({message})
}
})
This is my variable in the Secrets tab
Your project link(s)
https://boilerplate-express.k191378.repl.co/json
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36
Challenge: Basic Node and Express - Use the .env File
Link to the challenge: