Link to challenge: /apis-and-microservices/basic-node-and-express/use-the–env-file/ (I’m too new to post whole links here yet )
I know that the .env file is supposed to be a “secret” file but I hadn’t realized it’d be so hard to find. It seems I’m the only one with this problem. Everything on Google mentions either creating a .env file for specific projects or using the dotenv library to make working with .env easier but no FFC users seem to have had this issue so I must be missing something.
The challenge says " Let’s add an environment variable as a configuration option. Store the variable
MESSAGE_STYLE=uppercase in the
.env file." implying the env file is already there and server.js uses process.env I in my mind it must be there (but maybe not locally in my project?). Please advise
@throwawayffc Welcome to the forum.
Here the file
This file contain a key
Apparently you use vscode. You may have to change a vscode configuration. Did you download a copy of the github repository?
I pulled the files from Github, not using Glitch for this. I suspect it wasn’t included on Github since Github flags users who post their env files
Possibly GitHub is the cause of the stuck. Now, if you want to work locally, Glitch offers you the download of all the files.
That’s good to know about Glitch…
Creating a “.env” file seems to have worked so I think I’m good there.
Special shout out to you @yoelvis for the lightning fast relies and being more helpful than the internet in helping me work this out
Just to clarify, there is nothing magical about a .env file. It is just another file. You should be able to see it (although some environments make all files that begin with a period hidden unless you do something to see them.)
By convention, we usually put something in the .gitignore file that tells git not to save that file on the repo. That way it is “secret” - visible to you but no one else can see it. In theory though, you could make any file a “secret” file or make the .env a regular file. But it is a common convention to use .env for things you need secret.
thanks buddy . this challenge made me a little bit confused.