How to use the sails/node_modules/express.static function in sails

To help you get started, we’ve selected a few sails examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sailshq / treeline1 / legacy / lib / actions / run.js View on Github external
return function (req, res, next) {
          var pub = path.resolve(__dirname, '../../assets');
          var treelineStatic = express['static'](pub);
          treelineStatic(req, res, function (err) {
            if (err) return next(err);
            return flatFileMiddleware(req, res, next);
          });
        };
      })(),
github sailshq / treeline1 / legacy / lib / actions / run.js View on Github external
www: (function() {
        var pub = path.resolve(process.cwd(), '.tmp/public');
        var flatFileMiddleware = express['static'](pub);

        return function (req, res, next) {
          var pub = path.resolve(__dirname, '../../assets');
          var treelineStatic = express['static'](pub);
          treelineStatic(req, res, function (err) {
            if (err) return next(err);
            return flatFileMiddleware(req, res, next);
          });
        };
      })(),
    }