初学者,按照例子敲的, http://www.nodebeginner.org/index-zh-cn.html 这个里面的例子.
var http = require(“http”); 而 var url = require(“url”);
function start() { function onRequest(request, response) { var pathname = url.parse(request.url).pathname; console.log(“Request for " + pathname + " received.”); response.writeHead(200, {“Content-Type”: “text/plain”}); response.write(“Hello World”); response.end(); }
http.createServer(onRequest).listen(8888); console.log(“Server has started.”); }
exports.start = start;
而 var url = require(“url”); 这句话出错… node.js没url这个模块? 难道这个url是自定义的模块? 还是新版本没url这个模块了?
求指点一二. 谢谢啊
我参数写错了…关贴…!