Nodejs, the platform that runs JavaScript as a server, moves the front-end JavaScript to the servers, and the Google V8 engine makes it very efficient to run asynchronously without any blocking. Nodejs contains the HTTP server, which can implement the web system design, the client-side JavaScript compiler, and a series of functions.
Tools/Materials
Method/Step
Download Windows platform NODEJS Environment installation package, Baidu Nodejs official website, find downloads click, find Windows Installer if 64-bit PC can choose 64-bit version. Click Download.
Install Windows version Nodejs, click on the downloaded file to install and then click Next, then select agree to install the protocol, then click Next, then you can customize the installation directory by default C:\Program files\nodejs\, then click Next, Install all the components by default, then click Next, then tap Install to wait, then click Finish to install.
Write test file Test.js Here we'll put it on the D-disk demo.
var http = require ("http");
Http.createserver (function (request, response) {
Response.writehead ($, {"Content-type": "Text/plain"});
Response.Write ("Test Nodjs");
Response.End ();
}). Listen (8899);
Console.log ("Nodejs Start listen 8899 port!");
Set the browser port information here we use 8899.
Go to the node. js Command Prompt Commands window, enter the CD C:\Program files\nodejs\node_modules\npm\test enter the directory and then node test.js
Type node Test.js
Then the browser opens http://127.0.0.1:8899/to see the output of test Nodjs. Environment Installation Configuration succeeded
END
Precautions
1.node.js Windows Environment Setup