Environment variables - adam-kostuch/terminal-backend GitHub Wiki
In this page you'll find out how what are environemnt variables used for and how to use them.
- What are env vars for? The simplest anserw to this is safety! In a lot of cases in your projects you use something like API's, usernames and password to third part sides that you don't wont to publish. There with help are comming those variables.
- How to use them? In order to actually manage them is to download
dotenv
package. Then all you need to do is import dotenv, and use methodconfig
on it. You can see an example of it's usage inenv/config.ts
file. Lastly all you need to do is import this config to your file and use env vars likeprocess.env.VARIABLE
and so on.