mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
Merge branch 'master' of https://github.com/psychobunny/node-forum
This commit is contained in:
@@ -3,22 +3,16 @@ 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('/login', function(req, res) {
|
||||
@@ -30,10 +24,7 @@ var express = require('express'),
|
||||
|
||||
|
||||
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() {
|
||||
@@ -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.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);
|
||||
|
||||
Reference in New Issue
Block a user