Posts

Showing posts from December, 2017

Build WebServer With Node.js

Image
Node.js is a javascript server side framework. It means we can execute javascript code at the serverside and aslo all client requests will be processed with javascript. It is asynchronous. It means when you are doing server side i/o related operations still parallely it can handle other requests. Hence it can handle heavy load traffic.  Prerequisites: 1. Download and Install Node.js from here . 2. Any Editor like Notepad/Notepad++/Visual Studio Code. How to Create a WebServer: Step #1: Write the below code into a notepad and save it with some name like index.js var  http = require( 'http' );      http.createServer( function  (req, res) {       res.writeHead(200, { 'Content-Type' :  'text/plain' });       res.end( 'Hello World!' );   }).listen(5000);   In the above code you can see req and res parameters. The req object c...