Pseudo-code: if path is /health return 200 OK JSON.
Ready — edit the code above and click Run.
const path = "/health";
if (path === "/health") {
console.log(JSON.stringify({ status: 200, body: { ok: true } }));
} else {
console.log(JSON.stringify({ status: 404, body: { error: "Not found" } }));
}
Try solving on your own first, then reveal the official answer.
Express abstracts this—understand raw http.createServer callback for interviews.