This entire Node and Express section has been giving me a lot of trouble. The concepts are easy enough, but I keep getting stuck for hours on little issues like Replit bugs and submitting locally and stuff like that.
I thought I was good to go, but now I am stuck on this using the .env file challenge.
FCC says I need to use a Replit secret, so I went ahead and did that. I was able to access the mySecret variable that was generated, and it did equal uppercase, but my .get() function seems to not be running, altogether.
Could someone please lmk what is wrong with my code, hopefully for the last time this week?
To add onto what RandellDawson said, you shouldn’t store process.env.MESSAGE_STYLE into a variable. The way the test works is that the value of process.env.MESSAGE_STYLE will change in order to verify your results. If process.env.MESSAGE_STYLE is stored in a variable; your code will not correctly respond.
I got rid of the mySecret variable, then accessed process.env['MESSAGE_STYLE'] from inside the handler, BUT added quotes around MESSAGE_STYLE, which I think was something that had messed me up on a previous attempt.
I guess you must omit quotation marks around variables inside the .env file, but still need them when accessing them from the outside, even for variables.