app.js 479 B

123456789101112131415161718192021
  1. var $URL, $socket;
  2. $(function () {
  3. var ENV = 'chess';
  4. //var ENV = 'code';
  5. //var ENV = 'dev';
  6. var $WS;
  7. if (ENV === 'dev') {
  8. $URL = 'http://127.0.0.1:8181';
  9. $WS = $URL;
  10. } else if (ENV === 'code') {
  11. $URL = 'http://code.davidawindham.com:8888';
  12. $WS = 'ws://code.davidawindham.com:8888/';
  13. } else if (ENV === 'chess') {
  14. $URL = 'http://chess.davidawindham.com';
  15. $WS = 'ws://chess.davidawindham.com:8181/';
  16. }
  17. $socket = io.connect($WS);
  18. });