Basic Node and Express - Use the .env File
The Test Wont Pass No matter what i try. Ive tried about 7 different solutions but the test wont pass no matter what. In my .env file i Have this :
MESSAGE_STYLE=uppercase
and my code for the question is below. If anyone can spot an issue or tell me how to solve this id be very happy. Thanks.
This is my code so far, Ive also tried a few other solutions.
app.get("/json", function(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/83.0.4103.106 Safari/537.36
.
Challenge: Use the .env File
Link to the challenge: