code: function genUrl(opts, path) {
    // If the host already has a path, then we need to have a path delimiter
    // Otherwise, the path delimiter is the empty string
    var pathDel = !opts.path ? '' : '/';
  
    // If the host already has a path, then we need to have a path delimiter
    // Otherwise, the path delimiter is the empty string
    return opts.protocol + '://' + opts.host +
           (opts.port ? (':' + opts.port) : '') +
           '/' + opts.path + pathDel + path;
  }
docs: Generate a URL with the host data given by opts and the given path