I have the following very simple code snippet in node.js (running under Windows 7)
var path = url.parse(req.url, true).pathname;
var href = url.parse(req.url, true).href;
console.log("path " + path + "\r\n");
console.log("href " + href + "\r\n");
I invoke the listener with localhost:8080/test
I would expect to see:
path /test
href /localhost:8080/test
Instead I get
path /test
href /test
Why is href not the the full url?
req.urlonly contains the path, that's why routes are matched asapp.get('/test')