2

When I change the url in the client from localhost to myLiveServer.com, how do I make sure that the localStorage doesn't get synced with the live data? Do I need to configure that somewhere and extend the url like... localhost:8080/gun/dev and myLiveServer.com/gun/live

Jingle
  • 573
  • 3
  • 15

1 Answers1

2

Yes, it is probably wise to do something like this:

var gun = Gun('http://localhost:8080/gun').get('development');

And then in production, do something like:

var gun = Gun('http://myserver.com/gun').get('uniqueAppName');

Great question though, maybe this is something we can improve/make easier in the future.

Let me know if this works.

marknadal
  • 7,534
  • 4
  • 25
  • 22
  • 1
    Sounds good to me. Maybe make this a mandatory setting, so developers don't forget to "namespace" their servers – Jingle Jun 05 '17 at 15:42