Use function to determine ES URL