Tell us what’s happening:
After going through multiple other forum posts, YouTube videos, and freeCodeCamp’s “Get a Hint” button, I cannot figure out what is wrong with my code when trying to get through the .env portion.
I have created the “Secret” tab .env key and value, so I am unsure if I went wrong there. It is MESSAGE_STYLE=uppercase.
I have starred at this for so long I can’t think of anything else to try. Any help would be appreciated.
on the left side of replit app. there is a tab called ‘secret’, put your .env variable there. and access that variable in your code using process.env.YOUR_VAR
and dont forget to require('dotenv').config() at the beginning of your code
I have the MESSAGE_STYLE=uppercase in the secrets tab already with the key being MESSAGE_STYLE. Within the app.get() I have the const mySecret = process.env[‘MESSAGE_STYLE’] above the ‘if’ statement as shown below.
I had changed it to mess around and see if anything else would work. I stepped away before I could change it back but I originally had it the way I did in my post.
can you show a screenshot of the secrets tab?
generally, never share your environment variables, but in this case it is not a password or API token, so it’s fine
yes, but the live app doesn’t necessarily have that code - have you pressed Run recently? have you saved? I still don’t see the updated code in the replit, so the app you submit doesn’t have the new code