[Node. js learning] -- (1) -- HelloWord, node. js -- helloword
Today, I practiced an entry-level case of nodejs, which is very lightweight and fast!
Official Website
Http://nodejs.org/download/
Download
Windows 7 64-bit download msi installation package:
Http://nodejs.org/dist/v0.12.0/x64/node-v0.12.0-x64.msi
Install
All the way crazy
Install to drive F: \ nodejs
Execute common JS
Create in the installation directory
Hello. js
Console. log ("hello world! ");
Go to the installation directory and execute nodehello. js. The effect is as follows:
Start the server to run js
Create http. js
Var http = require ("http"); http. createServer (function (request, response) {response. writeHead (200, {"Content-Type", "text/html"}); response. write ("Hello World! "); Response. end () ;}). listen (8000 );
Run
Enter in the browser
Http: // localhost: 8000/indicates the running effect:
Reference
Http://www.cnblogs.com/jununx/p/3369781.html
Http://nodejs.org/download/