1.

How To Get The Full Url In Express?

Answer»

VAR PORT = req.app.settings.port || cfg.port;

res.locals.requested_url = req.protocol + '://' + req.host + ( port == 80 || port == 443 ? '' : ':'+port ) + req.path;

var port = req.app.settings.port || cfg.port;

res.locals.requested_url = req.protocol + '://' + req.host + ( port == 80 || port == 443 ? '' : ':'+port ) + req.path;



Discussion

No Comment Found