The http module is used to create a web server using Node.js.
const http = require("http");
const server = http.createServer((req, res) => {
res.writeHead(200, {
"Content-Type": "text/html"
});
res.end("Hello from Node.js Server!");
});
server.listen(3000);