Installation
Node.js can be installed from below link
https://nodejs.org/
Creating a Simple Server in Node.js
Steps:-
1.) Create a javascript file say HelloWorld.js with below content
var http = require(‘http’);
http.createServer(function (request, response) {
response.writeHead(200, {‘Content-Type': ‘text/plain’});
response.end(‘Hello World\n’);
}).listen(8888, ‘127.0.0.1’);
2.) To run the file open Node.js command prompt
3.)Type below command
Node Helloworld.js
4.) Open any browser and navigate to http://localhost:8888/