From 2d8725d522770c535e382ec9f81ded14cb349135 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 22 Apr 2013 15:23:02 -0400 Subject: [PATCH] changing socket.io to exist on the same port as the server, made config file template (removed config file from repo) --- .gitignore | 15 ++++++++------- public/config.default.json | 6 ++++++ public/config.json | 6 ------ src/webserver.js | 1 + src/websockets.js | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 public/config.default.json delete mode 100644 public/config.json diff --git a/.gitignore b/.gitignore index dac9b9918d..81ff636051 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ -################# -## npm -################# - -npm-debug.log -node_modules/ -sftp-config.json +################# +## npm +################# + +npm-debug.log +node_modules/ +sftp-config.json +public/config.json diff --git a/public/config.default.json b/public/config.default.json new file mode 100644 index 0000000000..b81885cda2 --- /dev/null +++ b/public/config.default.json @@ -0,0 +1,6 @@ +{ + "socket" : { + "address" : "localhost", + "port" : "4567" + } +} \ No newline at end of file diff --git a/public/config.json b/public/config.json deleted file mode 100644 index e8f8030db9..0000000000 --- a/public/config.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "socket" : { - "address" : "198.199.80.41", - "port" : "8081" - } -} \ No newline at end of file diff --git a/src/webserver.js b/src/webserver.js index 674fd98a29..dbbb65ff4f 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -44,3 +44,4 @@ var express = require('express'), }(WebServer)); server.listen(config.port); +global.server = server; \ No newline at end of file diff --git a/src/websockets.js b/src/websockets.js index 6ed57f6edc..521f76702c 100644 --- a/src/websockets.js +++ b/src/websockets.js @@ -1,5 +1,5 @@ -var SocketIO = require('socket.io').listen(8081); +var SocketIO = require('socket.io').listen(global.server); (function(io) {