NODE.JS freaking me out :O

Tell us what’s happening:
I have created a code for the .env challenge and the code works fine while I trigger the browser website. but when I submit link to freecodecamp, it says test failed.

Your code so far

/** 5) serve JSON on a specific route */
app.get("/json", (req, res) => {
var response = “Hello json”;
if (process.env.MESSAGE_STYLE === “uppercase”){
response = response.toUpperCase();
}

res.json({“message”: response});
});

in .env file : MESSAGE_STYLE=uppercase

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36.

Challenge: Use the .env File

Link to the challenge:

Hello and welcome to the FCC community~!

As a matter of curiosity, are you using Glitch for your project? It seems they are currently facing some stability issues which may be causing your tests to fail.

If you’d like, I’d be more than happy to look over your code if you provide the link to your project. :slight_smile:

1 Like

All the solution works fine on browser but freecodecamp tests still fails… here’s the link to my code: https://glitch.com/edit/#!/glossy-cooing-icebreaker

Would you mind changing this line in your package.json:
"fcc-express-bground": "https://github.com/freeCodeCamp/fcc-express-bground-pkg.git",
To this:
"fcc-express-bground": "https://github.com/Sky020/fcc-express-bground-pkg.git",

Re-run the tests, once the app is up.

1 Like

tried but not working…

Thank you. I needed to make sure.

I will keep debugging.

I can confirm, the issue is with Glitch. I have tested locally, and all works as expected.

So, should we wait until the Glitch issue is solved?

Welcome, hpdipto.

Yes, it seems like it. You can continue with many of the other lessons, though.