Basic Node and Express - Use the .env File

Tell us what’s happening:

My code can’t seem to pass the test case. Even though the correct output is being shown at the ‘/json’ endpoint. Any help?

This the code:

app.get(“/json”,(req, res) => {

mySecret = process.env.MESSAGE_STYLE

if( process.env.MESSAGE_STYLE == “uppercase”){
message = “Hello Json”.toUpperCase();
else if( process.env.MESSAGE_STYLE != “uppercase”){
message = “Hello json”;


This is my variable in the Secrets tab


Your project link(s)

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: Basic Node and Express - Use the .env File

Link to the challenge:

Your solution is correct, but you submitted the wrong URL to FCC. You should submit the base URL, without /json at the end, like this:

If you submit, then it will try to connect to, which does not exist.

You can keep that in mind for future challenges on replit – always submit the base URL of your project.

You were right, i submitted the base URL and it worked! Thanks a lot :slight_smile:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.