From a2d727dd869a00b4f8ce9cb62407db09bee8b779 Mon Sep 17 00:00:00 2001
From: Julian Lam <julian@designcreateplay.com>
Date: Mon, 22 Apr 2013 14:16:24 -0400
Subject: [PATCH] setting up config file for use in app, updated readme

---
 .gitignore                  |  3 ++-
 README.md                   | 23 ++++++++++++++++++++---
 config.js                   |  5 +++++
 config.json                 |  0
 public/templates/header.tpl |  2 +-
 src/webserver.js            |  5 ++---
 6 files changed, 30 insertions(+), 8 deletions(-)
 create mode 100644 config.js
 delete mode 100644 config.json

diff --git a/.gitignore b/.gitignore
index db2bf00d5a..771027916c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,4 +5,5 @@
 npm-debug.log
 node_modules/
 !/node_modules/
-!src/node_modules/
\ No newline at end of file
+!src/node_modules/
+sftp-config.json
diff --git a/README.md b/README.md
index e0411f30d6..b84dbd8e4e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,23 @@
-Installation
+# node-forum
+**node-forum** is a robust nodejs driven forum built on a redis database.
 
-1. npm install
+## Installation
 
-2. sudo node app
+1. `$ npm install`
 
+2. `node app`
+
+## Config
+
+node-forum is pre-configured to run on port 4567, with default options defined in config.json. The following options are available:
+
+<table>
+	<tr>
+		<th>Option</th>
+		<th>Description</th>
+	</tr>
+	<tr>
+		<td><b>port</b></td>
+		<td><i>(Default: 4567)</i> The default port that node-forum runs on</td>
+	</tr>
+</table>
\ No newline at end of file
diff --git a/config.js b/config.js
new file mode 100644
index 0000000000..5edb9eb8d1
--- /dev/null
+++ b/config.js
@@ -0,0 +1,5 @@
+var config = {
+	"port": 4567
+}
+
+module.exports = config;
\ No newline at end of file
diff --git a/config.json b/config.json
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/public/templates/header.tpl b/public/templates/header.tpl
index c392fd2253..da6c1c2839 100644
--- a/public/templates/header.tpl
+++ b/public/templates/header.tpl
@@ -113,7 +113,7 @@
       }
 	</style>
 	<script>
-	var socket = io.connect('http://198.199.80.41:8081');
+	var socket = io.connect('http://198.58.101.18:8081');
 
 	socket.on('event:connect', function(data) {
 		
diff --git a/src/webserver.js b/src/webserver.js
index 8c22b763e2..195af823a0 100644
--- a/src/webserver.js
+++ b/src/webserver.js
@@ -1,13 +1,12 @@
 var express = require('express'),
     connect = require('connect'),
+    config = require('../config.js'),
     WebServer = express();
 
 
 (function(app) {
 	var templates = global.templates;
 
-
-
 	app.get('/test', function(req, res) {
 		var body = 'testing';
 		res.setHeader('Content-Type', 'text/html');
@@ -46,7 +45,7 @@ var express = require('express'),
 			});
 		});
 		
-		app.listen(80);
+		app.listen(config.port);
 	}
 
 }(WebServer));