Tell us what’s happening:
Hi guys. I’ve been stuck on this for a while. I created .env file with MESSAGE_STYLE=uppercase
Then, i used the following code:
app.get('/json', (req, res) => {
let message = 'Hello json';
(process.env.MESSAGE_STYLE === 'uppercase')
? message=message.toUpperCase()
: message=message;
res.json({'message': message});
});
But i keep on getting this error:
The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE
Please help! i’m using Gitpod
###Your project link(s)
solution: https://3000-freecodecam-boilerplate-1zidflin9dg.ws-eu115.gitpod.io
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
Challenge Information:
Basic Node and Express - Use the .env File