examples/middleware.css.injection.js
function(req, res, next) {
        var parsed = require("url").parse(req.url);
        if (parsed.pathname.match(/\.less$/)) {
            return less(parsed.pathname).then(function(o) {
                res.setHeader("Content-Type", "text/css");
                res.end(o.css);
            });
        }
        next();
    }
function(req, res, next) {
        var parsed = require("url").parse(req.url);
        if (parsed.pathname.match(/\.less$/)) {
            return less(parsed.pathname).then(function(o) {
                res.setHeader("Content-Type", "text/css");
                res.end(o.css);
            });
        }
        next();
    }
function ( req , res , next ) { var parsed = require ( "url" ) . parse ( req . url ) ; if ( parsed . pathname . match ( / \.less$ / ) ) { return less ( parsed . pathname ) . then ( function ( o ) { res . setHeader ( "Content-Type" , "text/css" ) ; res . end ( o . css ) ; } ) ; } next ( ) ; }
Catch all requests, if any are for .less files, recompile on the fly and
send back a CSS response
Catch all requests if any are for . less files recompile on the fly and send back a CSS response