fixed all.js

This commit is contained in:
David Baldwynn 2015-07-13 15:11:40 -07:00
parent 4978da1163
commit 2ef7eea959
2 changed files with 11 additions and 3 deletions

4
config/env/all.js vendored
View File

@ -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',

View File

@ -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]);