Basic Node and Express - Use the .env File ->
having a problem with submitting the challenge
var response = "Hello World";
app.get("/json", function(req, res) {
console.log(process.env.MESSAGE_STYLE,"<=message style");
if (process.env.MESSAGE_STYLE === "uppercase") {
res.json({
"message": response.toUpperCase()
})
} else {
res.json({
"message": response
})
}
My .env file configration ->
MESSAGE_STYLE=uppercase
getting Error says
// running tests The response of the endpoint
/json
should change according to the environment variable
MESSAGE_STYLE
// tests completed
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.101 Safari/537.36
.
Challenge: Use the .env File
Link to the challenge: