Skip to content

Environment Variables

deploymentenvironment-variables

Environment variables are small pieces of information stored outside your program that the program can read when it runs. They usually hold settings like passwords, database URLs, or API keys.

How it works

When a program starts, it can look into the computer's environment to get these values. Instead of writing a password directly into the code, you store it as an environment variable. The program then reads it when needed. This makes code safer and easier to change without editing it.

Analogy

environment variables Think of a hotel with a board in the hallway that shows useful info like "breakfast time" or "wifi password". The guests (programs) don't store this info inside their rooms - they just check the board when they need it. Environment variables work the same way.

environment variables