Sunday 29 March 2020

Understanding the use of process.env in a web app

I was looking at an example React site and somebody used process.env to get a token-like object. This token along with the person's username would then determine whether or not the person could access the site.From reading about process.env it's related to whatever setup/environment the user has on their system. So I was thinking process.env would do something to get the person's relevant token. However when examining the code further there's actually a Config file with a hardcoded token (so I assume it's the same for all users). In this case why use process.env?

Submitted March 29, 2020 at 07:29PM by furthacharm

No comments:

Post a Comment