Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Moving router above static
Browse files Browse the repository at this point in the history
  • Loading branch information
amoshaviv committed Dec 23, 2013
1 parent 0c869a2 commit 14147f7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions config/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ var express = require('express'),
config = require('./config');

module.exports = function(app, passport, db) {
app.set('showStackError', true);
app.set('showStackError', true);

//Prettify HTML
app.locals.pretty = true;

Expand All @@ -21,10 +21,6 @@ module.exports = function(app, passport, db) {
level: 9
}));

//Setting the fav icon and static folder
app.use(express.favicon());
app.use(express.static(config.root + '/public'));

//Don't use logger for test env
if (process.env.NODE_ENV !== 'test') {
app.use(express.logger('dev'));
Expand Down Expand Up @@ -67,6 +63,10 @@ module.exports = function(app, passport, db) {

//routes should be at the last
app.use(app.router);

//Setting the fav icon and static folder
app.use(express.favicon());
app.use(express.static(config.root + '/public'));

//Assume "not found" in the error msgs is a 404. this is somewhat silly, but valid, you can do whatever you like, set properties, use instanceof etc.
app.use(function(err, req, res, next) {
Expand All @@ -91,4 +91,4 @@ module.exports = function(app, passport, db) {
});

});
};
};

0 comments on commit 14147f7

Please sign in to comment.