Explanation
Node.js lets you build APIs and background jobs in JavaScript with the event loop, modules, and npm.
Code example
javascriptimport { createServer } from "node:http";
const server = createServer((req, res) => {
res.writeHead(200, { "Content-Type": "application/json" });
res.end(JSON.stringify({ ok: true, path: req.url }));
});
server.listen(4000, () => console.log("http://localhost:4000"));Helpful resources
Exercise
Build a Node HTTP server that returns JSON for /health and 404 for unknown routes.
