USE TGE .env FILE CHALLENEGE

Tell us what’s happening:
The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE

Your code so far
//.env
MESSAGE_STYLE=uppercase

//MYAPP.JS
require(‘dotenv’).config()
app.get("/json", (req,res)=>{
if(process.env.MESSAGE_STYLE === “uppercase”){
res.json({“message”: “HELLO JSON”});
}
else{
res.json({“message”:“Hello Json”});
}
});

Your browser information:

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

Challenge: Use the .env File

Link to the challenge: