Tell us what’s happening:
Hey!!Plesae llok at the code below and tell me where is the false…The lesson isn’t passing and it says:
The response of the endpoint
/json
should change according to the environment variable
MESSAGE_STYLE
Please help
Your code so far
app.get("/json", function(req, res) {
if(process.env.MESSAGE_STYLE === ‘uppercase’) {
res.json({
“message”: “HELLO JSON”
});
}
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/80.0.3987.163 Safari/537.36.
@Klaudia, check https://basic-node-project-fcc.glitch.me/json returns lower case message.
In your code write only one /json route, number 5 json route is replacing number 6 json route.
Express runs first match route.