I'd rather use a regex replace to handle multiple backslashes here: `rootUrl.replace(/\/+$/, '')`