NodeGuy / server-date

Make the server's clock available in the browser.
http://www.nodeguy.com/serverdate/
Mozilla Public License 2.0
193 stars 52 forks source link

make ServerDate configurable #15

Closed dpalic closed 9 years ago

dpalic commented 10 years ago

Hi David,

I like your ServerDate implementation!

I tried to incorporate it into a Java project but got stuck since some issues arise with the current implementation. Mostly because configurations are missing.

For example:

Please make the ServerDate.js independent from a json call and make it more configurable. I like the great idea behind the ServerDate and would like to reuse it in some projects but mostly against java. For Java I could provide you a impl, if you want.

best wishes, Darko

NodeGuy commented 9 years ago

I'm sorry I didn't respond sooner; I just realized that I have to manually "watch" my own Github project to receive notifications.

  • you extract the URL from the script path. This assumes, that all have to do the following:
    • on get provide the script to the client
    • on the same get provide the servertime as param at the end of the call

What behavior would you prefer instead, exactly?

  • synchronizationIntervalDelay is currently unconfigurable

Are you sure? It's intended to be configurable like this:

ServerDate.synchronizationIntervalDelay = 60 * 60 * 1000; // ms
  • iteration < 10 defines unconfigurable samples taken

I don't understand what you mean here, would you please clarify?

Please make the ServerDate.js independent from a json call and make it more configurable.

I'm open to doing this if you are more specific about how you'd like the new API to look.