diff --git a/config/env/all.js b/config/env/all.js index 1f6bacce..1d898392 100755 --- a/config/env/all.js +++ b/config/env/all.js @@ -10,8 +10,8 @@ module.exports = { templateEngine: 'swig', //Sentry DSN Client Key - DSN: 'http://db01e03015ce48e2b68240ea8254b17c:5d878e9bb6c6488fbb70fb81295ee700@sentry.example.com/1' - + DSN: 'http://db01e03015ce48e2b68240ea8254b17c:5d878e9bb6c6488fbb70fb81295ee700@sentry.example.com/1', + // The secret should be set to a non-guessable string that // is used to compute a session hash sessionSecret: 'MEAN', diff --git a/config/express.js b/config/express.js index efd32fb4..0343a854 100755 --- a/config/express.js +++ b/config/express.js @@ -17,6 +17,7 @@ var fs = require('fs-extra'), helmet = require('helmet'), multer = require('multer'), passport = require('passport'), + raven = require('raven'), mongoStore = require('connect-mongo')({ session: session }), @@ -25,6 +26,13 @@ var fs = require('fs-extra'), consolidate = require('consolidate'), path = require('path'); +// function onError(err, req, res, next) { +// // The error id is attached to `res.sentry` to be returned +// // and optionally displayed to the user for support. +// res.statusCode = 500; +// res.end(res.sentry+'\n'); +// } + module.exports = function(db) { // Initialize express app var app = express(); @@ -71,7 +79,7 @@ module.exports = function(db) { // Should come before any other error middleware app.use(raven.middleware.express.errorHandler(config.DSN)); - //app.use(onError); // optional error handler if you want to display the error id to a user + app.use(onError); // optional error handler if you want to display the error id to a user // Set swig as the template engine app.engine('server.view.html', consolidate[config.templateEngine]);