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
To add compress middleware of express, I find this thread and
sails-middleware-example-issue are very usefull.
npm install express
var exp = require('express')
$app_dir/config/local.js
express: { customMiddleware: function (app) { console.log("config of Middleware is called"); app.use(exp.logger()); app.use(exp.compress()); app.use(function (req, res, next) { console.log("installed customMiddleware is used"); next(); }) } }