I am using Replit to complete the challenges. I am using the logic as mentioned below.
app.get(‘/json’, (req, res) => {
if(process.env[‘MESSAGE_STYLE’] === “uppercase”){
response = “Hello World”.toUpperCase();
}else{
response = “Hello World”;
}
res.send({“message” : response})
});
It is giving the following error:
The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE
Can anyone help me in resolving the issue?
PS: I have created the env variable in lock section of the replit, as mentioned in the instruction set.
solution: boilerplate-express - Replit
Link to the challenge: