javascript - Equivalent of window.locaton and window.pathname in NodeJS -


what equivalent window.location.protocol , window.location.host in nodejs/expressjs?

i'm trying redirect url site using third party api.

the nodejs api url.format(urlobject) method returns formatted url string derived urlobject.

var url = require('url');  function getformattedurl(req) {     return url.format({         protocol: req.protocol,         host: req.get('host')     }); }  res.redirect(getformattedurl(req)); 

Comments

Popular posts from this blog

java - Suppress Jboss version details from HTTP error response -

gridview - Yii2 DataPorivider $totalSum for a column -

Sass watch command compiles .scss files before full sftp upload -