express get host url

JavaScript
var fullUrl = req.protocol + '://' + req.get('host') + req.originalUrl;const hostWithProtocol = req.protocol + '://' + req.get('host')
Source

Also in JavaScript: