var http = require(“http”);//引入一个http的模块? var url = require(“url”);//引入路径模块
var server = http.createServer(function (req,res) { //parse(路径,第二个参数为将请求参数解析为对象) var urlObj = url.parse(req.url,true); console.log(urlObj);
res.end();
}); server.listen(8080);