Sharaxaad
Node.js wuxuu kuu oggolaanayaa inaad dhisto APIs iyo jobs JavaScript ah event loop, modules, iyo npm.
Tusaale code
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"));Agab waxtar leh
Layli
Dhis Node HTTP server oo soo celinaya JSON /health iyo 404 routes aan la aqoon.
