Basic Server run code in node js

technical talkiess
0

 const http = require("http");

const fs = require("fs");

const server = http.createServer((req,res)=>{
res.statusCode = 200;
res.setHeader("Content-Type","text/html");
res.end("vishal");
});

server.listen(80,'127.0.0.1',()=>{
    console.log("The port is listening");
});
Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)