I am getting an error. Here is a picture of the error. Please help if you can :.D
In this part of the video, he created a .env
file in repl.it
, and I cant do that.
Link to Video
Challenge: Handle Click Events with JavaScript using the onclick property
Link to the challenge:
as written there you canât create an .env
file
it is a recent change you need to use the Secret tab in the menu to the left
1 Like
I donât understand. I cant see a Secret Tab on the left
Hey @Shadow2 ,
In the sidebar (which is the left of the screen in replit) there is a button that looks like a lock, thatâs the secret tab:
1 Like
Hi @Catalactics ,
I checked that our right now, thanks! So, after I open that, what do I do next? In this Video , he makes a .env
file. I donât get it thoughâŚ
instead of writing a key=value
like shown in the video, you write the two things in the two fields
1 Like
What two things in the two fields??
So when he puts MONGO_URI
you put that inside the âkeyâ and your secret inside the âvalueâ input
1 Like
ilenia
May 27, 2021, 8:47pm
10
the key in the key field, the value in the value field
in this case I think itâs something like MONGO_URI=gibberish
, so MONGO_URI
in the key field, and the gibberish in the value field
1 Like
Okay, thanks. I will try that, and let you know if it works
Thanks! I will ty this as well.
ilenia
May 27, 2021, 8:49pm
13
note that itâs the same thing explained in two different ways, not two different things
1 Like
Hi again,
I tried the suggestion you made to me, but it made this
const mySecret = process.env['.env']
. Can you walk me through/help to solve the challenge?
I havenât done replit, but if itâs handling the env variable for you, then you shouldnât need to worry about the â.envâ file, all of your environment files will just become part of the process.env object. So, you if you created an environment variable called âAPI_KEYâ, then youâd access it as process.env.API_KEY in your code.
Or, seeing Catalactics post, you would access that variable as process.env.MONGO_URI .
1 Like
Thank you very much, sir! I think, I will just do the test for this section in Glitch.
Thank you everyone for the help!!
1 Like
system
Closed
November 26, 2021, 9:03am
17
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.