How to use the middleware function from less

Find comprehensive JavaScript less.middleware code examples handpicked from public code repositorys.

141
142
143
144
145
146
147
148
149
150
if (options.cacheFile && !cacheFileInitialized) {
  initCacheFile(options.cacheFile, log);
}

// Expose for testing.
less.middleware._saveCacheToFile = _saveCacheToFile;

// Actual middleware.
return function(req, res, next) {
  if ('GET' != req.method.toUpperCase() && 'HEAD' != req.method.toUpperCase()) { return next(); }
fork icon77
star icon269
watch icon10

+ 3 other calls in file

38
39
40
41
42
43
44
45
46
47
*
* Following that we have a `static` layer setup to serve the .css
* files generated by Less.
*
*      var server = connect.createServer(
*          less.middleware({
*              src: __dirname + '/public',
*              compress: true
*          })
*        , connect.static(__dirname + '/public')
fork icon77
star icon0
watch icon0