Tell us what’s happening:
// running tests The response of the endpoint /json
should change according to the environment variable MESSAGE_STYLE
// tests completed
The response of the endpoint /json
should change according to the environment variable MESSAGE_STYLE
Your code so far
https://glitch.com/~gainful-tamarind/json
var data = {"message": "Hello json"};
app.get("/json", function(req, res) {
if (process.env.MESSAGE_STYLE === 'uppercase'){
data.message = data.message.toUpperCase();
res.json(data);
} else {
res.json(data);
}
});
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36
.
Challenge: undefined
Link to the challenge:
https://www.freecodecamp.org/learn/apis-and-microservices/basic-node-and-express/use-the-.env-file