Basic Node and Express - Use the .env File

Who who help check this please?

It keep on saying The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE even after I have tried over and over .


app.get("/json", function handler(req, res) {
  // res.json({ "message": "Hello json" })
  if (process.env.MESSAGE_STYLE === "uppercase") {
    res.json({
      message: "Hello json".toUpperCase()
    })
  } else {
    res.json({
      message: "Hello json"
    })

  }
})

Your browser information:

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

Challenge Information:

Basic Node and Express - Use the .env File

can you give more details? what are you using to write the code and make it live?

Here are the links please

https://replit.com/@enigma-devhub/boilerplate-npm

The live site https://boilerplate-npm-enigma-devhub.replit.app

An over-zealous spam filter was blocking you from posting the link to your repl but hopefully it should work now?

This link is not passing on the FCC site: https://boilerplate-npm-enigma-devhub.replit.app/

The live link for your project can be found if you click on the Open in new tab button highlighted below, and paste that url into the solution link box.

You should find that that link ( https://boilerplate-npm.enigma-devhub.repl.co/) will pass the challenge.

Untitled

Thank you very much, but I can’t find this on my Replit dashboard

From your POV you should find it next to your Webview window.

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