Skip to content
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

Closed
dennisreimann opened this issue Sep 6, 2010 · 5 comments
Closed

before/after filters in 1.0 #424

dennisreimann opened this issue Sep 6, 2010 · 5 comments

Comments

@dennisreimann
Copy link

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

@tj
Copy link
Member

tj commented Sep 6, 2010

lets move this to the express-contrib repo :D will be a good fit there, lets keep core minimal

@dennisreimann
Copy link
Author

Yeah, very good idea!

@tj
Copy link
Member

tj commented Sep 6, 2010

been meaning to start that for a while lol but i think it's a great way to provide some more functionality without imposing

@changchang
Copy link

is there any module implementing the filter api? i'm looking for that, too. can you tell me the url of the filter module?

@tj
Copy link
Member

tj commented Jul 31, 2011

@changchang route-specific middleware provide this sort of functionality now

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants