revamped client side scripts so that they are loaded using Require.js instead.

This commit is contained in:
Julian Lam
2013-10-03 15:04:25 -04:00
parent b49c7b8609
commit 038e04dee6
60 changed files with 2472 additions and 2431 deletions

View File

@@ -135,22 +135,22 @@ var express = require('express'),
app.use(function (req, res, next) {
res.status(404);
// respond with html page
if (req.accepts('html')) {
if (path.dirname(req.url) === '/src/forum') {
// Handle missing client-side scripts
res.type('text/javascript').send(200, '');
} else if (req.accepts('html')) {
// respond with html page
winston.warn('Route requested but not found: ' + req.url);
res.redirect(nconf.get('relative_path') + '/404');
return;
}
// respond with json
if (req.accepts('json')) {
res.send({
} else if (req.accepts('json')) {
// respond with json
res.json({
error: 'Not found'
});
return;
} else {
// default to plain-text. send()
res.type('txt').send('Not found');
}
// default to plain-text. send()
res.type('txt').send('Not found');
});
app.use(function (err, req, res, next) {