Horumarinta Web Full Stack
Tallaabo 11 / 21120 daqiiqo

Node.js

Backend & APIs

Sharaxaad

Node.js wuxuu JavaScript ku ordaa server-ka si aad u dhisto APIs, scripts, iyo adeegyo backend luqad keliya.

Tusaale code

javascript
import { 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");
});

Agab waxtar leh

Layli

Abuuri Node HTTP server yar oo soo celinaya JSON oo diiwaangelinaya request kasta.