I have a weird bug with the “Basic Node and Express - Use the .env file” challenge…
What’s happening is that the process.env.MESSAGE_STYLE is showing as undefined, and when I print out the process.env object, this is what the console shows:
Here’s my code for this challenge: app.get(“/json”, (req, res) => {
let _response = “Hello json”;
if (process.env.MESSAGE_STYLE === “uppercase”) {
_response = _response.toUpperCase();
}
res.json({“message”: _response});
})
And my .env file: MESSAGE_STYLE=uppercase
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Sorry, I was going to add what the console shows, but when I put it and tried to post this, I got a notification saying something like “You are not allowed to post this link”, so I removed it but forgot to remove that last part. Do you want me to send that? If so, how can I get around the notification? Also, I can send all the code in a bit