禁用Sails.js静态资产服务

我怎样才能完全closures静态资产? 我想我可能可以做到:

module.exports = { // Init custom express middleware express: { customMiddleware: function (app) { app.use(express.static(__dirname + '/some_empty_folder')); 

但是这对我来说并不好。 有没有办法closuresconfiguration中的静态资产服务?

您可以通过从/config/http.js中的中间件中删除www中间件来closures静态资产的服务:

 module.exports.http = { middleware: { order: [ 'startRequestTimer', 'cookieParser', 'session', 'bodyParser', 'handleBodyParserError', 'compress', 'methodOverride', 'poweredBy', '$custom', 'router', // 'www', 'favicon', '404', '500' ] } }; 

你可以创build一个没有前端的风帆应用程序 – 无前端

 sails new [appName] --no-frontend 

这将避免创build资产文件夹和咕噜任务。