Can someone please explain why does this not work?
app.get("/json", (req, res) => {
if(process.env.MESSAGE_STYLE === ‘uppercase’){
res.json({“message”: “HELLO JSON”})
} else {
res.json({“message”: “Hello json”})
}
})
it gives the correct output. Also, the hint code is quite similar. Any help would be highly appreciated.
Your project link(s)
solution: https://replit.com/@smeetthakkar/boilerplate-express-2
https://boilerplate-express-2.smeetthakkar.repl.co/json
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.61 Safari/537.36
Challenge: Use the .env File
Link to the challenge: