Hello Route
A route matches a method + path. The handler receives req and res. Send JSON with res.json or text with res.send.
- app.get("/", (req, res) => res.send("ok"))
- Status defaults to 200 unless you set otherwise.
- Keep handlers thin — call services for logic.
const path = "/";
const method = "GET";
console.log(method, path, "ok");
After you read this chapter, use Write (when available) and Quiz on this page to lock it in.