Why should I use it?
Node.js turns out to be a great choice for all the following scenarios:
- I/O applications
- Applications that are data intensive
- Applications that require a lot of data streaming
Some of its key features include:
- Event-driven- The technology is non-blocking, event-driven runtime. This means a Node.js server would not wait for the response from the previous call. Rather it would move on to the next call. Moreover, it takes advantage of events to get notifications on the response to a call.
- Performance- Node.js being asynchronous and fast, it doesn’t make use of buffering and transfers data in chunks.
- Scalable- Node.js is single-threaded with event looping and is a highly scalable environment. Unlike many traditional servers, Node.js uses a single thread and works in a non-blocking way — using an event looping mechanism.
Building a HTTP Web Server In Node.Js
In case, if you have already downloaded Node.Js and installed in your system then you can simply set up HTTP web server on your system. To do this, follow these steps outlined below:
- Open a Command Prompt Window in the administrator mode
- Type the following command there:
npm install -g http-server
- Switch to the directory that contains the static website files
- Next, start the web server using the following command
So that’s all for now! A minimalistic web server has been set up locally in your system. You can now browse http://localhost:8080 from your web browser.
Check out all the software testing webinars and eBooks here on EuroSTARHuddle.com
In a nutshell