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.

  1. 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.
  2. 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 method config on it. You can see an example of it's usage in env/config.ts file. Lastly all you need to do is import this config to your file and use env vars like process.env.VARIABLE and so on.