๐Ÿ“Š We use cookies & analytics to improve your experience. Learn more
Latest

Cloud, Linux & DevOps Basics Module 4 ยท Lesson 12 of 15

0% Exit to course

Module 4 ยท Containers and environments Lesson 12 of 15

Config and secrets across environments

Learning objective

The same code runs in development, staging and production; only the configuration differs. Keys, hosts and flags come from the environment, not from code that gets edited by hand.

Worked example

process.env.DATABASE_URL is set differently on each machine, so the deploy never has to change a line of source.

Your practice task

Move three hard-coded settings into environment variables and provide a .env.example for the next developer.

Do this before moving on. Reading a solution teaches the shape of it; typing it teaches you.

Key takeaway

The same code runs in development, staging and production; only the configuration differs. Keys, hosts and flags come from the environment, not from code that gets edited by hand.

Create free account or sign in

Almost there

15 lessons left of 15

Finish every lesson to unlock the certificate. Each one ends in a practice task โ€” do them and the final project brief writes itself.