What is a better way to authenticate some of the routes on Express 4 Router?
I'm using Express 4 where I have a route protected by passport.js, like this: var media = require('express').Router(); media.get('/', function(req, res) { // provide results from db }); media.post('/', passport.authenticate('bearer'), function(req, res) { // This route is auth protected }); So - get collection routes should (mostly) not be protected for me, and create/update routes should. But this requires me to pass passport to all my route files (I have 7 so far), then to add that as a middleware to some of them. I like the version where you can do something like this: var router = require(