I’m trying to resolve this task here:
https://www.freecodecamp.org/learn/apis-and-microservices/basic-node-and-express/use-the-.env-file
but even though the code I wrote is correct, FCC validator says is not correct
The code does what is suppose to do, that is changing to upper case when the env variable
MESSAGE_STYLE=uppercase
/** 5) serve JSON on a specific route */
var message = "Hello json";
app.get("/json", (req, res) => {
res.json({
message: message
});
});
/** 6) Use the .env file to configure the app */
if (process.env.MESSAGE_STYLE === "uppercase") {
message = "Hello json".toUpperCase();
} else {
message = "Hello json";
}
here is the live link:
why the code is not accepted?
and the resut in the link https://foam-cacao.glitch.me/json is: