javascript - Pass a route segment as callback argument -



javascript - Pass a route segment as callback argument -

i'm building first app in express. possible somehow pass route segment argument callback?

app.get('/connect/:mysegment', mycallback(mysegment));

specifically, i'm using passport several strategies authentication. rather doing,

app.get('/connect/twitter', passport.authorize('twitter') ); app.get('/connect/facebook', passport.authorize('facebook') );

i along lines of...

app.get('/connect/:service', passport.authorize(service));

of course, can do

app.get('/connect/:mysegment', function(req, res){ // can utilize req.params.mysegment });

javascript node.js express

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -