我正在阅读一本名为The Node Beginner Book 的关于 node.js 的入门书,并且在下面的代码中(书中给出)我不理解挂在 parse 方法上的 pathname 属性的重要性。所以我想知道它在做什么。我不清楚这种方法的文档
var pathname = url.parse(request.url)**.pathname;**
var http = require("http");
var url = require("url");
function start(route, handle) {
function onRequest(request, response) {
var pathname = url.parse(request.url).pathname; // I don't understand the pathname property
console.log("Request for " + pathname + " received.");
route(handle, pathname);
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
}