Hi,
Until a few days ago, I was able to edit my .env file. Now when I try to edit it, it asks me to add an ENVIRONMENT VAIABLE. I need to see my .env file. Then only I feel sure that I am doing the right thing. Please tell me how I can view my …env file. I also do not know exactly what you mean by theterm, ENVIRONMENT VARiABLE. For the time being, I am stuck. I can’t move forward. I have been with GLItch for more than 4 years.
Ahammadunny Pathiaseril.
My e-mail address: ahammadunny@hotmail.com
Hey @ahammadunny,
-
You should find your
.env
file in the filetree. If you don’t find it, click on New File and then type in.env
.
-
Once you have an
.env
file, click on ‘Add a Variable’. -
.env
variables take the form ofkey=value
. -
Enter the variable name in ‘Variable Name’ and the value of variable in ‘Variable Value’.
For example, if you’re building a Discord bot, you need to enterTOKEN
as the name of the variable and the token string as the variable value.
-
Then in your code, you should be able to refer to the
.env
variable using its key like this:
process.env.KEY
where KEY
is the variable name we gave.
More info here: https://glitch.happyfox.com/kb/article/18-how-do-i-store-secrets-credentials-or-private-data/
Hope this helps!
Hello,
I can see its name on the left. When I click on it, Usually the file appears on the screen. But from yesterday onwards, after you updated something, it shows all kinds of weird options like HIDE, SHOW etc. It does not show the ,env file. Howeever I try, the file ie the text of the file does not appear on the screen. That is the help I need. I do not need those HIDE, SHOW buttons there. Please allow me to edit my file. I can’t do it now. You can try on my behalf. I have no problem. Please help me.Thank you.
Ahammadunny Pathiaseril.
@ahammadunny There should be a button that says ‘plaintext’ (it has a picture of a little eye). This will allow you to view the normal file without the other buttons and new UI. This a very recent update to Glitch to make it easier to use. If this fixed your issue please mark it as a ‘solution’
Here’s a picture of the button I am talking about:
This is the button:
Hi Eddie,
It fixed my problem.Where should I click to show that it wsas the solution? Thank you vry much.
Sincerely yours,
Ahammadunny Pathiaseril.
@ahammadunny, at the bottom of @EddiesTech post, there is a button that says ‘Solution’. Clicking on it will mark @EddiesTech’s answer as solution.
That’s kinda out of this topic, isn’t it? FYI, I’m not.
yes, yes it is off-topic