Skip to content

Instantly share code, notes, and snippets.

View srounce's full-sized avatar

Samuel Rounce srounce

View GitHub Profile
@srounce
srounce / gist:3728963
Created September 15, 2012 17:31
Simple route specific middleware
var routeSpecificMiddleware = {
'/' : [],
'/private' : [ myAuthMiddleware ],
'/edit' : [ myAuthMiddleware, validator ],
'/register' : [ validator ]
};
var bindRoute = function(app, route, verb, handler)
{
verb = verb || 'all';