mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-22 16:30:34 +01:00
Merge branch 'master' of https://github.com/psychobunny/node-forum
This commit is contained in:
23
README.md
23
README.md
@@ -3,9 +3,17 @@
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. `$ npm install`
|
First step is to obtain all of the dependencies requires by node-forum:
|
||||||
|
|
||||||
2. `node app`
|
$ npm install
|
||||||
|
|
||||||
|
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
|
## Config
|
||||||
|
|
||||||
@@ -20,4 +28,15 @@ node-forum is pre-configured to run on port 4567, with default options defined i
|
|||||||
<td><b>port</b></td>
|
<td><b>port</b></td>
|
||||||
<td><i>(Default: 4567)</i> The default port that node-forum runs on</td>
|
<td><i>(Default: 4567)</i> The default port that node-forum runs on</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><b>mailer</b></td>
|
||||||
|
<td>
|
||||||
|
<i>(Default: {<br />
|
||||||
|
host: 'localhost',<br />
|
||||||
|
port: '25',<br />
|
||||||
|
from: 'mailer@localhost.lan'<br />
|
||||||
|
})</i><br />
|
||||||
|
Settings for the outgoing mailer (for emails involving user registration/password resets)
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
var config = {
|
var config = {
|
||||||
"port": 4567
|
"port": 4567,
|
||||||
|
"mailer": {
|
||||||
|
host: 'localhost',
|
||||||
|
port: '25',
|
||||||
|
from: 'mailer@localhost.lan'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
@@ -3,22 +3,16 @@ var express = require('express'),
|
|||||||
config = require('../config.js'),
|
config = require('../config.js'),
|
||||||
WebServer = express();
|
WebServer = express();
|
||||||
|
|
||||||
|
|
||||||
(function(app) {
|
(function(app) {
|
||||||
var templates = global.templates;
|
var templates = global.templates;
|
||||||
|
|
||||||
app.get('/test', function(req, res) {
|
app.get('/test', function(req, res) {
|
||||||
var body = 'testing';
|
var body = 'testing';
|
||||||
res.setHeader('Content-Type', 'text/html');
|
res.send(body);
|
||||||
res.setHeader('Content-Length', body.length);
|
|
||||||
res.end(body);
|
|
||||||
});
|
});
|
||||||
app.get('/', function(req, res) {
|
app.get('/', function(req, res) {
|
||||||
console.log(templates['header']);
|
console.log(templates['header']);
|
||||||
var body = templates['header'] + templates['home'] + templates['footer'];
|
res.send(templates['header'] + templates['home'] + templates['footer']);
|
||||||
res.setHeader('Content-Type', 'text/html');
|
|
||||||
res.setHeader('Content-Length', body.length);
|
|
||||||
res.end(body);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/login', function(req, res) {
|
app.get('/login', function(req, res) {
|
||||||
@@ -30,10 +24,7 @@ var express = require('express'),
|
|||||||
|
|
||||||
|
|
||||||
app.get('/register', function(req, res) {
|
app.get('/register', function(req, res) {
|
||||||
var body = templates['header'] + templates['register'] + templates['footer'];
|
res.send(templates['header'] + templates['register'] + templates['footer']);
|
||||||
res.setHeader('Content-Type', 'text/html');
|
|
||||||
res.setHeader('Content-Length', body.length);
|
|
||||||
res.end(body);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports.init = function() {
|
module.exports.init = function() {
|
||||||
@@ -45,11 +36,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.logger({ format: '\x1b[1m:method\x1b[0m \x1b[33m:url\x1b[0m :response-time ms' }));
|
||||||
app.use(express.methodOverride());
|
app.use(express.methodOverride());
|
||||||
app.use(express.static(global.configuration.ROOT_DIRECTORY + '/public'));
|
app.use(express.static(global.configuration.ROOT_DIRECTORY + '/public'));
|
||||||
app.set('mailOptions', {
|
app.set('mailOptions', config.mailer);
|
||||||
host: 'localhost',
|
|
||||||
port: '25',
|
|
||||||
from: 'admin@198.199.80.41'
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.listen(config.port);
|
app.listen(config.port);
|
||||||
|
|||||||
Reference in New Issue
Block a user