Basic Node and Express - Use the .env File

Tell us what’s happening:
Describe your issue in detail here.
it seems my -url/json not showing with the current code
if I use the the res.json("HELLO WORLD) its worked , but the ‘else’ function not showing

Your project link(s)

solution: boilerplate-express - Node.js Repl - Replit

Your browser information:

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

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

Link to the challenge:

  1. the message in uppercase
  2. just message without changes

should I define a message variable first?

I try to change the environment to check if the else working, but the console.log still shows the one in the if function

well the problem is the page my-url/json not loaded, I think I miss some code or something

“messages”: “HELLO JSON”

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