Merge branch 'master' of github.com:psychobunny/node-forum

This commit is contained in:
Julian Lam
2013-04-23 15:39:42 -04:00
6 changed files with 97 additions and 11 deletions

View File

@@ -7,19 +7,30 @@ var express = require('express'),
(function(app) {
var templates = global.templates;
function refreshTemplates() {
//need a better solution than copying this code on every call. is there an "onconnect" event?
if (DEVELOPMENT === true) {
// refreshing templates
modules.templates.init();
}
}
app.get('/', function(req, res) {
refreshTemplates();
res.send(templates['header'] + templates['home'] + templates['footer']);
});
app.get('/login', function(req, res) {
refreshTemplates();
res.send(templates['header'] + templates['login'] + templates['footer']);
});
app.get('/reset', function(req, res) {
refreshTemplates();
res.send(templates['header'] + templates['reset'] + templates['footer']);
});
app.get('/register', function(req, res) {
refreshTemplates();
res.send(templates['header'] + templates['register'] + templates['footer']);
});