Tell us what’s happening:
I’ve read every post about this topic, but I still couldn’t figure out why my code can’t pass the test. I’ve changed the name of the project, remixed the project. I also submitted the url without ‘/json’.
I get the following response:
The response of the endpoint /json
should change according to the environment variable MESSAGE_STYLE
Your code so far
Glitch live app: https://proud-dull-barometer.glitch.me
Glitch code: https://glitch.com/edit/#!/proud-dull-barometer
Core code:
app.get("/json", (req,res)=> {
var message = "Hello json";
if (process.env.MESSAGE_STYLE === "uppercase") {
message = message.toUpperCase();
}
res.json({"message": message});
});
.env setting:
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36
.
Challenge: Use the .env File
Link to the challenge: