I. Installation and Environment configuration:
The two articles are very detailed.
Http://www.cnblogs.com/seanlv/archive/2011/11/22/2258716.html
Http://www.tuicool.com/articles/UJNb2eJ
Two. Test case (Chinese garbled problem has been solved)
var http = require ("http");
Http.createserver (function (request, response) {
Response.writehead ($, {"Content-type": "Text/plain;charset=utf-8"});
Response.Write ("node is running, Test here");
Response.End ();
}). Listen (8899);
Console.log ("node is running, listening on port 8899!");
Which solves garbled problem need to pay attention to two points:
(1) JS file Set code
Response.writehead ($, {"Content-type": "Text/plain;charset=utf-8"});
(2) Change JS file encoding format to Utf-8
You can open the JS file by Notepad, select "File"-"Save as" to see if the encoding format is utf-8, and if not, store it after modification.
node. JS Beginner