Lesson 1 — Config & env
Settings live outside the code
DevOps is the work of building, shipping and running software reliably. Rule number one: settings like the port or the database address are not written into the code. They come from environment variables — named values set on the server (in Node: process.env.PORT). If one is missing, the app uses a safe default.
const region = env.REGION || "eu-west";
Note: real DevOps tools (CI servers, load balancers, Docker, Kubernetes) cannot run in your browser, so this exercise is a small plain-JS simulation of the logic those tools use. Here env is a plain object standing in for the server's environment.
Why it matters: the same build can run on a laptop, a test server and production — only the settings change.
Read the port and the log level from env with defaults 3000 and "info", then log both.
Run your code — when the output matches the task, you will see a green check. Then mark the lesson complete.
A quick 3-question quiz on this lesson — instant feedback.