Bsic Node and Express-Use the .env File-HELP

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.

Challenge: undefined

Link to the challenge:

Hi @Klaudia
I think you should remove or not set res.json({“message”: “hello json” .

Still isn’t passing…I tried to remove res.json({“message”: “hello json”}) but still isn’t working

Hi there,

Did you create the .env file and add MESSAGE_STYLE=uppercase?

will you please share codepen url ?

Yeah i created it but still isn’t working

I am not doing it on Code Pen but on Glitch

Could you post the link to your project so we could have a look?

Yes of course…

Hello @Klaudia, Actually problem is that you are sharing Project Page url of glitch , you should paste Live App url on freecodecamp.

Still isn’t passing…I copied Live App url and paste it in the lesson on freecodecamp but still is wrong

https://basic-node-project-fcc.glitch.me

This is the link of the Live App…

@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.

Yeah!! Thank you so much for helping!! Now is correct…Thank you so much and sorry for bothering!!

No problem :grinning: