650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/8D/1A/wKioL1iG7Quw6eaqAAAPzbYC7hI546.png-wh_500x0-wm_3 -wmp_4-s_2483031734.png "title=" Qq20170124135811.png "alt=" Wkiol1ig7quw6eaqaaapzbyc7hi546.png-wh_50 "/>
JS Code (SERVER.JS)
var http = require ("http");
Http.createserver (function (request,response) {
Response.writehead (200,{"Content-type": "Text/plain"});
Response.Write ("Hello World");
Response.End ();
}). Listen (8888);
Console.log ("server running 127.0.0.1:8888");
Execute JS Code
CMD into the command-line program
Switch to the directory where the Server.js is located
Use node Server.js in Nodejs to perform
Post-execution command-line results
650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M01/8D/1D/wKiom1iG7ezj-vOrAAAHzWg1wM4649.png-wh_500x0-wm_3 -wmp_4-s_909702758.png "title=" Qq20170124140157.png "alt=" Wkiom1ig7ezj-voraaahzwg1wm4649.png-wh_50 "/>
This article is from the "Yan" blog, please be sure to keep this source http://suyanzhu.blog.51cto.com/8050189/1894040
HTTP Server for Nodejs