Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
.env Vs. api.json
Prior to this lesson I've been storing API keys in a hidden .env file and using process.env.API_KEY to access it.
Is there a benefit to using api.json over .env? Is one approach more secure than the other?
Heidi FryzellFront End Web Development Treehouse Moderator 25,046 Points
Thanks for reaching out. I honestly don't know the answer to your question, it goes it little beyond my present experience level. I did do a Google search to try and understand what you were asking and this article might be helpful:
It talks about why you should use environment variables with a .env file over a config.json file.
I hope this helps in some way and happy coding! Heidi