get host url from express() app code example Example: express get host url const hostWithProtocol = req.protocol + '://' + req.get('host')