From 2980931f1ffa2261a36ccac6f3a96d7974c835e3 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 22 Apr 2013 14:20:50 -0400 Subject: [PATCH 1/3] updated readme --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b84dbd8e4e..b43e64f476 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,9 @@ 1. `$ npm install` -2. `node app` +2. `$ apt-get install redis` + +3. `$ node app` ## Config From 1d3d3df73bff59ab64f3431b1ef5fc992042e5fe Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 22 Apr 2013 14:37:13 -0400 Subject: [PATCH 2/3] optimizing for express, tweaks to config file --- config.js | 7 ++++++- src/webserver.js | 21 ++++----------------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/config.js b/config.js index 5edb9eb8d1..ac009fe563 100644 --- a/config.js +++ b/config.js @@ -1,5 +1,10 @@ var config = { - "port": 4567 + "port": 4567, + "mailer": { + host: 'localhost', + port: '25', + from: 'mailer@localhost.lan' + } } module.exports = config; \ No newline at end of file diff --git a/src/webserver.js b/src/webserver.js index 195af823a0..9c1c3a0c37 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -3,30 +3,21 @@ var express = require('express'), 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'); - res.setHeader('Content-Length', body.length); - res.end(body); + res.send(body); }); app.get('/', function(req, res) { console.log(templates['header']); - var body = templates['header'] + templates['home'] + templates['footer']; - res.setHeader('Content-Type', 'text/html'); - res.setHeader('Content-Length', body.length); - res.end(body); + res.send(templates['header'] + templates['home'] + templates['footer']); }); app.get('/register', function(req, res) { - var body = templates['header'] + templates['register'] + templates['footer']; - res.setHeader('Content-Type', 'text/html'); - res.setHeader('Content-Length', body.length); - res.end(body); + res.send(templates['header'] + templates['register'] + templates['footer']); }); module.exports.init = function() { @@ -38,11 +29,7 @@ var express = require('express'), app.use(express.logger({ format: '\x1b[1m:method\x1b[0m \x1b[33m:url\x1b[0m :response-time ms' })); app.use(express.methodOverride()); app.use(express.static(global.configuration.ROOT_DIRECTORY + '/public')); - app.set('mailOptions', { - host: 'localhost', - port: '25', - from: 'admin@198.199.80.41' - }); + app.set('mailOptions', config.mailer); }); app.listen(config.port); From 6da36bb8591c527480bcf8643688bf27ab990200 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 22 Apr 2013 14:45:33 -0400 Subject: [PATCH 3/3] more tweaks to readme --- README.md | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b43e64f476..4feb3418f7 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,17 @@ ## Installation -1. `$ npm install` +First step is to obtain all of the dependencies requires by node-forum: -2. `$ apt-get install redis` + $ npm install -3. `$ node app` +Next, we install redis. If you have redis installed, you can skip this step. + + # apt-get install redis + +Lastly, we run the forum. + + $ node app ## Config @@ -22,4 +28,15 @@ node-forum is pre-configured to run on port 4567, with default options defined i port (Default: 4567) The default port that node-forum runs on + + mailer + + (Default: {
+     host: 'localhost',
+     port: '25',
+     from: 'mailer@localhost.lan'
+ })

+ Settings for the outgoing mailer (for emails involving user registration/password resets) + + \ No newline at end of file