mondora / asteroid

An alternative client for a Meteor backend
MIT License
734 stars 101 forks source link

Changing endpoint dynamically. OR Re-instantiating asteroid object #127

Open AayushShrestha opened 6 years ago

AayushShrestha commented 6 years ago

I want to dynamically change the endpoint of asteroid object being used to switch between different servers (viz dev, staging, production). What would be the recommended way to do that? I realized that just changing the endpoint will not work. I have been able to make it work by simply creating a new asteroid object with the new endpoint and replacing with the one being used and then re-instantiating all the listeners. But I wanted to know if there is a better, cleaner way of doing it. Thanks