get url of server in express code example Example: express get host url const hostWithProtocol = req.protocol + '://' + req.get('host')