Home >Web Front-end >JS Tutorial >Detailed introduction to nodejs (combination of multiple articles)_javascript skills
A series of changes began with Node.js, a JavaScript toolkit for writing high-performance web servers. Uniquely, Node.js assumes you are running it in a POSIX environment, Linux or Mac OS X. If you are under Windows, you need to install MinGW to get a POSIX-like environment. In Node, HTTP is primary. Node is optimized for creating http servers, so most of the examples and libraries you see online are focused on the web (http frameworks, template libraries, etc.).
First, go to http://nodejs.org to download and install. The version I downloaded is 0.6.6. Installation is very simple, just take the next step.
My installation directory is C:Program Files (x86)nodejs.
1. helloworld
Create a new file hello.js in the nodejs installation directory, and type a line of code in it
Enter the command line console, enter the nodejs directory and type node hello.js
The console output "hello, nodejs."
2. Web version of helloworld
Create a new http.js in the nodejs installation directory, the code is as follows
Start the service in the command line and type node http.js
Then open the browser address bar and enter http://localhost:8000/. When you see Hello World! output on the page, it is successful.