you can have middleware that "wrap" other middleware, usage might look
something like:
app.get('/', authenticated(getUserOrders, getUserFavorites),
otherwise(getNewProducts, getLatestDeals), callback);
BUT in my opinion a nicer solution would be to have different routes
and rewrite req.url to point to those. for example
app.get('/', see if user is authenticated and rewrite url, then
next())
app.get('/user', getUserOrdder..., callback)
app.get('/products', ...., callback)
sorry for the short reply, i dont have much time but I hope that kinda
helps