I’m using replit to complete the back-end challenges. I am currently stuck on the 6th one in Basic Node and express, this is my code below:
const mySecret = process.env['MESSAGE_STYLE']
app.get("/json", (req,res) =>{
if (mySecret == "uppercase") {
res.json({
"message": "HELLO JSON"
});
} else {
res.json({
"message": "Hello json"
});
}
});
I inputted the secret and it prints out correctly when I use console.log(mySecret). It does not pass the test though.
Your project link(s)
solution: https://replit.com/@delaine3/boilerplate-express-1json
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:90.0) Gecko/20100101 Firefox/90.0
Challenge: Use the .env File
Link to the challenge: