expressjs: get requested url

Viewed 24382

I want to get the url the client has requested out of the request.

Currently I use:

var requestedUrl = req.protocol + '://' + req.host + ':3000' + req.url;

This isn't really nice at all. It also leaves out url fragments I require (#/something).

Is there a way I can get the complete url? Maybe out of the header?

Regards

4 Answers
Related