Module 4 ยท Containers and environments Lesson 12 of 15
Config and secrets across environments
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.
Keep your place in this course
A free account saves which lessons you have finished and unlocks the certificate. The lesson itself stays free to read.
Create free account or sign inCourse complete
You finished every lesson.
Your certificate is ready, and the projects you built are the proof to attach to an application.
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.