Skip to content
BENIBIX Learn

Configuration File

Development📄 Files & FormatsConfig Files

Also known as Config File, Settings File, Config

Settings a program reads when it starts. They sit in a file apart from the code.

Think of it like

Think of it like the settings page on a phone. You change how it works without opening it up.

Example

Emma's app reads port: 8080 from its config file. To move it to port 3000, she changes one line and restarts it.

Why it matters

With settings out of the code, one program can run in many places. Each place sets it up its own way.

Definition

A configuration file holds the settings a program reads when it starts. It sets things like the port to use, the database to connect to or which features are on. Changing the file changes how the program acts, with no change to its code. Common formats are YAML, JSON, TOML and INI. Most projects have several, one for each tool they use.

Common mistake

Putting passwords in a config file that is committed to Git. Secrets belong in a .env file or a secrets store.

Key takeaways

  1. 1
    Settings, not code. Change behaviour without editing code.
  2. 2
    Read at start. Most programs load it once.
  3. 3
    Many formats. YAML, JSON, TOML or INI.

Compare

Learn it properly