Official website:https://nodejs.org/
Introduction: Node.js®is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. node. JS uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive R Eal-time applications that run across distributed devices.
keywords: background language, Chrome's JavaScript runtime, Event-driven, non-blocking I/O model
installation mode:windows on the official website, click the Install button can be installed directly
The first of the HelloWorld: (a Web server)
1. Create a new Example.js file and enter the following code:
1 var http = require (' http '); 2 http.createserver (function (req, res) {3 res.writehead (200, {') Content-type ': ' Text/plain '}); 4 Res.end (' Hello world\n '); 5 }). Listen (1337, ' 127.0.0.1 '); 6 console.log (' Server running at http://127.0.0.1:1337/');
2, cmd to open the command line, go to the above new file directory, enter: Node Example.js (after the server startup effect is as follows)
3, the above said this is a Web server, so in the browser can be directly input http://127.0.0.1:1337/, you will see Hello World interface:
Description: from a simple example above, you must have seen the advantage of node. js, which is to build a Web server with just a few lines of code, which would allow the JSP to do more code.
extension: in the homepage of the install below there is an API Docs button, if you want to more detailed play node. js can start from here, at the same time there are more books on the market ~
[A dangerous] 1, node. js tries to install & run the first HelloWorld