Basic Node and Express - Use the .env File

Tell us what’s happening:

My Gitpod snapshot: Dashboard
Tried to solve the problem, but I don’t understand what I am missing. Made an if-else block to check for the MESSAGE_STYLE, but it is not chaning at the /json endpoint and I don’t know why. What am I missing?
I have an .env file with the message style (hopefully the snapshot is accessible) and I guess maybe the syntax is wrong. Tried the value in quotes and without, without change.

###Your project link(s)

solution: https://3000-freecodecam-boilerplate-xw1dbuyi07v.ws-eu114.gitpod.io

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:127.0) Gecko/20100101 Firefox/127.0

Challenge Information:

Basic Node and Express - Use the .env File

remove the parenthesis from there, and also remove the quotes

Ok, I remove the parenthesis and quotes. Tried it on the “/json” endpoint and with pasting the solution link in the course excercise. Still says " The response of the endpoint /json should change according to the environment variable MESSAGE_STYLE"
New snapshot: Dashboard
Don’t understand what I am doing wrong, because tried copying answers from others online, but without any change. :confused:

you are missing dotenv, it’s explained in the instructions that you need to configure it

Yeah, I skipped reading that part, because I just saw it is required if you programm locally and it already was in the package.json.
Thank you for the help :slight_smile:

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