-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
before/after filters in 1.0 #424
Comments
lets move this to the express-contrib repo :D will be a good fit there, lets keep core minimal |
Yeah, very good idea! |
been meaning to start that for a while lol but i think it's a great way to provide some more functionality without imposing |
is there any module implementing the filter api? i'm looking for that, too. can you tell me the url of the filter module? |
@changchang route-specific middleware provide this sort of functionality now |
Based on this mailinglist thread [1] I thought about porting the 0.1.x hooks over to 1.0, what do you think about that? I could imagine the API to be something like this:
var authenticate = function(req, res) { verifyUser(); };
app.before({ only: ['/mysecureroute', '/topsecret'], filter: authenticate });
app.before({ except: ['/login'], filter: authenticate });
app.before(authenticate); // use filter for all requests
[1] http://groups.google.com/group/express-js/browse_frm/thread/ba1280fb0304d067
The text was updated successfully, but these errors were encountered: