node.js web server
const http = require('http');
const port = 3000;
console.log(`Server is running on port ${port}`);
http.createServer(function(req, res){
res.writeHead(200, {'Content-Type': 'text/html'});
res.write('Write some HTML here...');
res.end();
}).listen(port);
// save this as server.js
// you have to download node.js
// open terminal or command prompt
// type node server.js
// find your server at http://localhost:3000
// to end the server, go to that terminal and press ctrl+c
// code by VARSHITH REDDY SATTI
// to create a server in node.js you should.
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
res.write("write html code to display you test")
res.end();
}).listen(8080);
// save this as httpServer.js
// run this by typing node httpServer.js in the command line
// to acess your server got to http://localhost:8080