I want to get the url the client has requested out of the request.
Currently I use:
var requestedUrl = req.protocol + \'://\' + req.host + \':3000\' + re
I often times add something like this to my express app:
app.use(function(req, res, next) { req.getRoot = function() { return req.protocol + "://" + req.get('host'); } return next(); });
Now you have a function you can call on demand if you need it.