Sailsjs Serve Static Directory
If you need to serve a static directory from your Sails application you can extend the http.js
configuration file.
module.exports.http = {
middleware: {
custom: true
},
customMiddleware: function(app){
var express = require('express');
var dirpath = require('path').join(sails.config.paths.tmp, 'uploads');
app.use('/uploads', express.static(dirpath));
}
};