Using $location.host() instead of hard coding localhost