And the answer is ... skipper isn't going to help here. Rather, (just as in a generic express app) use middleware before skipper which sets req._body = true
to fool upstream bodyParser (which is skipper by default for sails).
In my case, in config/http.js:
var typeIs = require('type-is');
module.exports.http = {
middleware: {
order: [
...
'dontParseCSV',
...
'bodyParser',
...
],
dontParseCSV: function (req, res, next) {
if(typeIs(req, 'csv')) {
// fool body parser into thinking already parsed
// so we can stream csv
req._body = true;
}
next();
},
...
}
};
The router comes after bodyParser, so it might be a bit inconvenient to do
this for just a particular route (at least if you want the router to recognize
the route and not just hack in a regexp :)). In my case, all my other routes accept only json, so it isn't a problem.