mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
added connect-flash package. npm also alphabetically re-ordered the deps... thanks npm?
This commit is contained in:
57
package.json
57
package.json
@@ -15,42 +15,43 @@
|
|||||||
"test": "mocha ./tests -t 10000"
|
"test": "mocha ./tests -t 10000"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"async": "~0.2.8",
|
||||||
|
"bcryptjs": "~0.7.10",
|
||||||
|
"connect-flash": "^0.1.1",
|
||||||
|
"cron": "~1.0.4",
|
||||||
|
"daemon": "~1.1.0",
|
||||||
"express": "3.2.0",
|
"express": "3.2.0",
|
||||||
"express-namespace": "~0.1.1",
|
"express-namespace": "~0.1.1",
|
||||||
"socket.io": "~0.9.16",
|
|
||||||
"socket.io-wildcard": "~0.1.1",
|
|
||||||
"passport": "~0.2.0",
|
|
||||||
"passport-local": "0.1.6",
|
|
||||||
"marked": "0.2.8",
|
|
||||||
"async": "~0.2.8",
|
|
||||||
"gm": "1.14.2",
|
"gm": "1.14.2",
|
||||||
"gravatar": "1.0.6",
|
"gravatar": "1.0.6",
|
||||||
"nconf": "~0.6.7",
|
|
||||||
"sitemap": "~0.7.3",
|
|
||||||
"winston": "~0.7.2",
|
|
||||||
"rss": "~0.2.0",
|
|
||||||
"request": "~2.34.0",
|
|
||||||
"prompt": "~0.2.11",
|
|
||||||
"uglify-js": "git+https://github.com/julianlam/UglifyJS2.git",
|
|
||||||
"validator": "~3.4.0",
|
|
||||||
"cron": "~1.0.4",
|
|
||||||
"semver": "~2.2.1",
|
|
||||||
"string": "~1.7.0",
|
|
||||||
"xregexp": "~2.0.0",
|
|
||||||
"bcryptjs": "~0.7.10",
|
|
||||||
"less": "~1.6.3",
|
"less": "~1.6.3",
|
||||||
"daemon": "~1.1.0",
|
"marked": "0.2.8",
|
||||||
"underscore": "~1.6.0",
|
|
||||||
"mkdirp": "~0.3.5",
|
"mkdirp": "~0.3.5",
|
||||||
"rimraf": "~2.2.6",
|
"nconf": "~0.6.7",
|
||||||
"npm": "^1.4.6",
|
"nodebb-plugin-dbsearch": "0.0.9",
|
||||||
"nodebb-plugin-mentions": "~0.5.0",
|
|
||||||
"nodebb-plugin-markdown": "~0.4.1",
|
"nodebb-plugin-markdown": "~0.4.1",
|
||||||
"nodebb-widget-essentials": "~0.0.21",
|
"nodebb-plugin-mentions": "~0.5.0",
|
||||||
"nodebb-theme-vanilla": "~0.0.21",
|
|
||||||
"nodebb-theme-lavender": "~0.0.26",
|
|
||||||
"nodebb-plugin-soundpack-default": "~0.1.1",
|
"nodebb-plugin-soundpack-default": "~0.1.1",
|
||||||
"nodebb-plugin-dbsearch": "0.0.9"
|
"nodebb-theme-lavender": "~0.0.26",
|
||||||
|
"nodebb-theme-vanilla": "~0.0.21",
|
||||||
|
"nodebb-widget-essentials": "~0.0.21",
|
||||||
|
"npm": "^1.4.6",
|
||||||
|
"passport": "~0.2.0",
|
||||||
|
"passport-local": "0.1.6",
|
||||||
|
"prompt": "~0.2.11",
|
||||||
|
"request": "~2.34.0",
|
||||||
|
"rimraf": "~2.2.6",
|
||||||
|
"rss": "~0.2.0",
|
||||||
|
"semver": "~2.2.1",
|
||||||
|
"sitemap": "~0.7.3",
|
||||||
|
"socket.io": "~0.9.16",
|
||||||
|
"socket.io-wildcard": "~0.1.1",
|
||||||
|
"string": "~1.7.0",
|
||||||
|
"uglify-js": "git+https://github.com/julianlam/UglifyJS2.git",
|
||||||
|
"underscore": "~1.6.0",
|
||||||
|
"validator": "~3.4.0",
|
||||||
|
"winston": "~0.7.2",
|
||||||
|
"xregexp": "~2.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"mocha": "~1.13.0"
|
"mocha": "~1.13.0"
|
||||||
|
|||||||
@@ -12,7 +12,9 @@ function createStatic(statusCode) {
|
|||||||
res.statusCode = parseInt(statusCode, 10);
|
res.statusCode = parseInt(statusCode, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
res.render(statusCode, {});
|
res.render(statusCode, {
|
||||||
|
errorMessage: req.flash('errorMessage')[0] || undefined
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ var templates = require('./../../public/src/templates'),
|
|||||||
nconf = require('nconf'),
|
nconf = require('nconf'),
|
||||||
express = require('express'),
|
express = require('express'),
|
||||||
winston = require('winston'),
|
winston = require('winston'),
|
||||||
|
flash = require('connect-flash'),
|
||||||
|
|
||||||
relativePath,
|
relativePath,
|
||||||
viewsPath,
|
viewsPath,
|
||||||
@@ -138,12 +139,13 @@ function handleErrors(err, req, res, next) {
|
|||||||
// here and next(err) appropriately, or if
|
// here and next(err) appropriately, or if
|
||||||
// we possibly recovered from the error, simply next().
|
// we possibly recovered from the error, simply next().
|
||||||
console.error(err.stack);
|
console.error(err.stack);
|
||||||
|
|
||||||
var status = err.status || 500;
|
var status = err.status || 500;
|
||||||
res.status(status);
|
res.status(status);
|
||||||
|
|
||||||
res.json(status, {
|
req.flash('errorMessage', err.message);
|
||||||
error: err.message
|
|
||||||
});
|
res.redirect('500');
|
||||||
}
|
}
|
||||||
|
|
||||||
function catch404(req, res, next) {
|
function catch404(req, res, next) {
|
||||||
@@ -190,6 +192,7 @@ module.exports = function(app, data) {
|
|||||||
app.engine('tpl', templates.__express);
|
app.engine('tpl', templates.__express);
|
||||||
app.set('view engine', 'tpl');
|
app.set('view engine', 'tpl');
|
||||||
app.set('views', viewsPath);
|
app.set('views', viewsPath);
|
||||||
|
app.use(flash());
|
||||||
|
|
||||||
app.enable('view cache');
|
app.enable('view cache');
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user