Explanation
Node.js runs JavaScript on the server so you can build APIs, scripts, and backend services with one language.
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, message: "Hello from Node" }));
});
server.listen(3000, () => {
console.log("Server on http://localhost:3000");
});Helpful resources
Exercise
Create a small Node HTTP server that returns JSON and logs each request.
