Here is a great way to add a function you can call on the req object to get the url
app.use(function(req, res, next) {
req.getUrl = function() {
return req.protocol + "://" + req.get('host') + req.originalUrl;
}
return next();
});
Now you have a function you can call on demand if you need it.