Skip to content

Commit 2bda23d

Browse files
committed
Merge pull request #93 from zfarrell/errorHandler
fix(server): fix configuration so that (express) errorHandler works
2 parents 458a2f6 + 25e39f1 commit 2bda23d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: templates/express/config/express.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ module.exports = function(app) {
2525

2626
app.use(express.static(path.join(config.root, '.tmp')));
2727
app.use(express.static(path.join(config.root, 'app')));
28-
app.use(express.errorHandler());
2928
app.set('views', config.root + '/app/views');
3029
});
3130

@@ -60,7 +59,12 @@ module.exports = function(app) {
6059
app.use(passport.initialize());
6160
app.use(passport.session());
6261
<% } %>
63-
// Router needs to be last
62+
// Router (only error handlers should come after this)
6463
app.use(app.router);
6564
});
65+
66+
// Error handler
67+
app.configure('development', function(){
68+
app.use(express.errorHandler());
69+
});
6670
};

0 commit comments

Comments
 (0)