used window.location.origin instead
Added env dist