Skip to content

Commit

Permalink
handle app routes before handling collection routes
Browse files Browse the repository at this point in the history
this is mainly to ensure global handlers like parsing frontmatter are done before more specific collection middleware is handled on a collection
  • Loading branch information
doowb committed Apr 14, 2016
1 parent 0ea0b36 commit f47385f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/plugins/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ module.exports = function(proto) {
return;
}

// handle the collection routes first, then handle the app routes
// handle the app routes first, then handle the collection routes
var collection = this[view.options.collection];

collection.handle(method, view, function(err) {
this.router.handle(view, function(err) {;
if (err) return done(err);
this.router.handle(view, done);
}.bind(this));
collection.handle(method, view, done);
});
};

/**
Expand Down

0 comments on commit f47385f

Please sign in to comment.