In my ExpressJS app, several of my urls handlers have the following logic:
- See if the user has permission to access a resource
- If so, continue
- Else, redirect to the main handler.
Is there a way to insert a pre-handler for certain url handlers, via ConnectJS or ExpressJS?
I know I can do it globally, for all handlers, (which I do to insert missing headers as a result from IE's broken XDR).
But, can I do this for a subset of handlers?