*Tell us what’s appening:
Describe your issue in detail here.
I am working on the " Use the .env File" activity. I am implementing the code on REPL.IT. I believe the code is correct. When accessed directly from Chrome browser a correct JSON file is returned ({“message”:“HELLO WORLD”}).
From the freecodecamp web page I encounter:
// running tests The response of the endpoint /json should change according to the environment variableMESSAGE_STYLE (Test timed out)
I get your point. I err’ed in the cut and paste to the original error report. My bad. The problem is still there.
My code is returning {“message”:“HELLO JSON”}
It is from the code
app.get(“/json”, function (req,res)
{
if (process.env.MESSAGE_STYLE===‘uppercase’) {
response = “Hello JSON”.toUpperCase();
}
else {
response = “Hello json”;
}
res.json({
“message”: response
});
The error report from freecodecamp is:
// running tests
The response of the endpoint /json
should change according to the environment variable MESSAGE_STYLE
// tests completed
I stopped and started REPL.IT. Is there something I should do on freecodecamp? When you say “passes” - was that from looking at browser output, or are you able to somehow run it from within freecodecamp’s test?
Yeah, I am sorry. I am thrashing now. Wasting everyone’s time at this point. It will take me a bit to walk back to where I was. You should probably go do something productive. I don’t feel I am being productive at this moment.
For all the tests it works like that. You never submit the path just the root URL. The test will use the root URL as the starting point for any fetch it makes to the backend and whatever path it needs to test.