balderdashy/sails — pull request #1035 by ragulka (2013-10-26 12:48:24+00:00)
Title: Allow setting hook priority

This PR allows setting a priority number for a hook. Hooks with higher priority will be loaded before others. Higher priority = lower number. Lower priority = higher number.

The default priority is 10. This should allow enough flexibility to load user-defined hooks before built-in hooks.

An example use-case is where a user wants run some middleware before the built-in CORS or CSRF middleware, potentially to do some kind of pre-filtering or whitelisting, etc.