I\'ve just unpacked a fresh copy of the Node framework Sails.js. It is built on Express 3. In the /config/routes.js file is this comment:
/**
* (1) Core m
I had the same issue of figuring out how to make use of middlewares.
They are basically defined in the config/policies.js
.
So, if you want to use middlewares(aka policies) like old style, you can do the following (this may not be the nicest way):
// config/policies.js
'*': [
express.logger(),
function(req, res, next) {
// do whatever you want to
// and then call next()
next();
}
]
However, the real sailjs way is to put all such policies in api/policies/
folder